Re: [R] S3 vs. S4

From: Marc Schwartz <>
Date: Mon 02 Jan 2006 - 07:59:49 EST

On Sun, 2006-01-01 at 13:07 -0600, Erin Hodgess 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?
> Thanks in advance!
> R Version 2.2.0 (I'm downloading the new one this afternoon!) Windows.
> Happy New Year!

Some places to start:

  1. Fritz Leisch's "S4 Classes and Methods" from the useR! 2004 meeting:

2. Doug Bates' "Converting Packages to S4" in R News 3/1, 2003:

3. Thomas Lumley's "Programmer's Niche: A Simple Class, in S3 and S4"

   in R News 4/1, 2004:

Also, if you do a Google search with the following:

that will bring up some discussions (248 hits) in the list archives, mainly in r-devel, some of which will be relevant to your question.

In addition, you might want to look at:

  1. John M. Chambers. Programming with Data. Springer, New York, 1998. ISBN 0-387-98503-4. AKA "The Green Book"
  2. William N. Venables and Brian D. Ripley. S Programming. Springer,
  3. ISBN 0-387-98966-8.
HTH, Marc Schwartz mailing list PLEASE do read the posting guide! Received on Mon Jan 02 08:08:41 2006

This archive was generated by hypermail 2.1.8 : Mon 02 Jan 2006 - 09:36:03 EST