[R] Developing R classes

Frank E Harrell Jr f.harrell at vanderbilt.edu
Wed Dec 29 04:16:42 CET 2004


Gabor Grothendieck wrote:
> 
> Chambers book, Programming with Data, has a lot about S4.
> 
> Note that S4 has more features but S3 is simpler and 
> has higher performance so its not all one way.  Also, they
> are related so if you learn the simpler S3 first it will
> make it easier to learn S4 later.  
> 
> I suggest you download and read the source code for
> package `zoo' for S3 and package `its' for S4.  Both packages
> define irregular time series classes.

I agree with Gabor.  S3 is much easier and faster to implement and has 
flexibility advantages (e.g., adding new elements to fit objects for 
debugging).

Frank

> 
> Date:   Tue, 28 Dec 2004 13:46:10 -0300 (ART) 
> From:   Gilvan Justino <giljustino at yahoo.com.br>
> To:   <r-help at stat.math.ethz.ch> 
> Subject:   [R] Developing R classes 
> 
>  
> Hi,
> 
> I´m trying to write some R classes but I din´t find documentation enought to develop them. I read there is 2 ways to write classes, using S3 ou S4 models. And it seems that S4 is the best model, so I thing I should use this one. 
> 
> I´m new user of R and I´m searched on the net some information about creating new classes. I found this document:
> http://www.biostat.harvard.edu/courses/individual/bio271/lectures/L11/S4Objects.pdf
> If someone knows some docs about creating our own classes, could please, post its url at here ?
> 
> More one question... It seems that some documents about S can be applyed to R. How do you know if you can use this documentation using R ? I´m asking this because some stufs I was looking for I found more explanation using S and not R. Am I right or I´m looking in the wrong place ?
> 
> Thanks a lot!
> 
> ______________________________________________
> R-help at stat.math.ethz.ch mailing list
> https://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html
> 


-- 
Frank E Harrell Jr   Professor and Chair           School of Medicine
                      Department of Biostatistics   Vanderbilt University




More information about the R-help mailing list