Re: [R] data encapsulation with classes

From: hadley wickham <h.wickham_at_gmail.com>
Date: Sun 08 Apr 2007 - 14:06:26 GMT

On 4/8/07, Roger Bivand <Roger.Bivand@nhh.no> wrote:
> On Sun, 8 Apr 2007, Peter Williams wrote:
>
> > Hi All,
> >
> > I'm new to R from a C and Octave/Matlab background. I am trying to
> > construct some classes in R to which I want to attach pieces of data.
> > First, is attr(obj, 'member name') <- data the accepted way of doing
> > this?
>
> No, it isn't. You seem to be trying to deduce new-style classes from a
> representation used before R 2.4, but in any case it would not be
> sensible. Please consult John M. Chambers. Programming with Data.
> Springer, New York, 1998, and/or William N. Venables and Brian D. Ripley.
> S Programming. Springer, New York, 2000, or for a shorter online resource:
>
>
http://www.stat.auckland.ac.nz/S-Workshop/Gentleman/Methods.pdf

Unfortunately, all of those references are at least 4 years out of date when it comes to S4 methods. Is there any comprehensive reference of the current implementation of the S4 OO system apart from the source code?

Hadley



R-help@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 and provide commented, minimal, self-contained, reproducible code. Received on Mon Apr 09 00:10:20 2007

Archive maintained by Robert King, hosted by the discipline of statistics at the University of Newcastle, Australia.
Archive generated by hypermail 2.1.8, at Mon 09 Apr 2007 - 08:31:21 GMT.

Mailing list information is available at https://stat.ethz.ch/mailman/listinfo/r-help. Please read the posting guide before posting to the list.