[R] S3 vs. S4

Sean Davis sdavis2 at mail.nih.gov
Tue Jan 3 12:52:12 CET 2006




On 1/1/06 2:07 PM, "Erin Hodgess" <hodgess at gator.dt.uh.edu> wrote:

> Dear R People: 
> 
> Could someone direct me to some documentation on the
> difference between S3 and S4 classes, please?
> 
> For example, why would a person use one as opposed to another?
> Maybe pros and cons of each?

The Bioconductor project has encouraged my use of S4 classes.  S4 allows
creation of data structures that have methods associated with them, so for
data-structure heavy programming, I think S4 might have some advantages, but
I am NOT an expert in the field.

Just one other link that I have found quite useful:

http://www.stat.auckland.ac.nz/S-Workshop/Gentleman/S4Objects.pdf

Sean




More information about the R-help mailing list