Hello, I see some people including myself confused by the different object-oriented approaches in R (S3, S4, OOP, R.oo etc.). Would it be ok to collect examples and solutions for the different OO-packages in one package and add a vignette for documentation? (assuming I find time for this task) I mean in this case the package would not add data or functionality to R or serve as a companion package for a book. In this case the package would (only) add documentation to R. Is this ok? ---- Friedrich Schuster Dompfaffenweg 6 69123 Heidelberg ------------------------------------------------------- -- ---- Friedrich Schuster Dompfaffenweg 6 69123 Heidelberg
Gabor Grothendieck
2010-Jul-27 20:46 UTC
[R] Documenting different OO-aproaches in R as a package?
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.
Martin Maechler
2010-Jul-28 20:16 UTC
[R] Documenting different OO-aproaches in R as a package?
>>>>> "s" == schuster <mail at friedrich-schuster.de> >>>>> on Tue, 27 Jul 2010 22:17:09 +0200 writes:s> Hello, s> I see some people including myself confused by the s> different object-oriented approaches in R (S3, S4, OOP, s> R.oo etc.). s> Would it be ok to collect examples and solutions for the s> different OO-packages in one package and add a vignette s> for documentation? (assuming I find time for this task) s> I mean in this case the package would not add data or s> functionality to R or serve as a companion package for a s> book. In this case the package would (only) add s> documentation to R. Is this ok? Hmm, we had discussed the issue within R Core in a team meeting many years ago. At the time, those present agreed that we should emphasize S3 (for "small" and "legacy" applications) and S4, and concentrate on these rather than fostering even more alternatives. Everything else has been by contributed by R users who were not happy with S4 ... at the time at least ... Note that in the last several R releases, S3 <-> S4 "interoparability" has been greatly improved. Martin Maechler, ETH Zurich s> ---- Friedrich Schuster Dompfaffenweg 6 69123 Heidelberg