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: 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! __________________________________________________ [[alternative HTML version deleted]]
Fritz's lecture at useR! 2004 may also be a good starting point: ci.tuwien.ac.at/Conferences/useR-2004/Keynotes/Leisch.pdf Andy> From: Gilvan Justino > > 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: > 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! __________________________________________________ [[alternative HTML version deleted]] ______________________________________________ R-help at stat.math.ethz.ch mailing list stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! R-project.org/posting-guide.html
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. 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: 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!
On Tue, 28 Dec 2004, Gilvan Justino wrote:> 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.There's a small example in the R Newsletter, Volume 1, 2004. -thomas
Gilvan Justino writes: > Hi, > > I??m trying to write some R classes but I din??t find documentation > enought to develop them. I have faced a similar problem. Here is the summary of what I have been able to find (including some of the responses that you have already received) with a focus on S4 classes since some people assert that all new development should be done with them. 1) I think that the three best free resources for learning about S4 classes are (in the order that I recommend you read them): omegahat.org/RSMethods/Intro.pdf (More or less Section 1.6 from The Green Book.) stat.auckland.ac.nz/S-Workshop/Gentleman/S4Objects.pdf (I think that this version of the talk is more up-to-date than the one located at the Bioconductor site at bioconductor.org/develPage/guidelines/programming/S4Objects.pdf) @Article{Rnews:Lumley:2004b, author = {Thomas Lumley}, title = {Programmers' Niche: A Simple Class, in {S3} and {S4}}, journal = {R News}, year = 2004, volume = 4, number = 1, pages = {33--36}, month = {June}, url = {CRAN.R-project.org/doc/Rnews}, } 2) If you want to get serious with S4 classes, you may need to purchase "Programming with Data" by John Chambers (aka The Green Book) and/or "S Programming" by Venable and Ripley. I own both, but am interested in finding material that is similarly comprehensive but free. Many of the people (read: students) that I urge to use R do not have the sort of budgets for buying books that I am lucky enough to have. 3) I found all of these references to be worth a read through. ci.tuwien.ac.at/Conferences/useR-2004/Keynotes/Leisch.pdf biostat.jhsph.edu/~rpeng/R-classes-scope.pdf stat.auckland.ac.nz/S-Workshop/Gentleman/Methods.pdf molgen.mpg.de/~wolski/Robject/Extending.pdf Hope that helps, Dave Kane PS. I can't access the stat.auckland site right now but have been able to in the past.