[R] Documenting different OO-aproaches in R as a package?

Gabor Grothendieck ggrothendieck at gmail.com
Tue Jul 27 22:46:48 CEST 2010


On Tue, Jul 27, 2010 at 4:17 PM, schuster <mail at friedrich-schuster.de> wrote:
>
>
> Hello,
>
> I see some people including myself confused by the different object-oriented
> approaches in R (S3, S4, OOP, R.oo etc.).

S3 is the primary OO approach in R and if you are new you should
initially focus on that both because of its primary role and its
simplicity which makes it very easy to learn.   You can't really use R
effectively without knowing S3 so this is the one to learn first
whereas you can use R effectively without knowing any of the others.

S4 is in the base of R and has more features but is more complex.
What you learn in S3 will apply in some form to learning S4.

Unlike S3 and S4 which are in the base of R, the others are in addon packages.

I am not sure that OOP is in a usable state.  I think the authors of
it focused on S4 instead.

You can get an idea of how proto is used by reviewing the list of
applications written in proto listed on the proto home page
(http://r-proto.googlecode.com) and there is a vignette (pdf document)
that comes with the package that explains it.

R.oo is the most like conventional OO programming in other languages
and there are a number of associated packages by the same author that
use R.oo that can serve as illustrations of how to use it.



More information about the R-help mailing list