Re: [R] Use of contains in S4 classes

From: Ross Boylan <ross_at_biostat.ucsf.edu>
Date: Sat 20 Aug 2005 - 08:42:00 EST

On Thu, 2005-08-18 at 17:30 -0500, Paul Roebuck wrote:
> On Thu, 18 Aug 2005, Ross Boylan wrote:
>
> > setClass("B", representation=representation("B", extra="numeric"))
> > setClass("B", representation=representation(extra="numeric"),
> > contains="B")
> > Are these the same? If not, how do they differ?
> >
> > What about
> > setClass("B", representation=representation("B", extra="numeric"),
> > contains="B")
> > ?
> >
> > As far as I can tell, the Green Book doesn't talk about a contains
> > argument to setClass.
>
> "S4 - Composition and Inheritance" by Witold Eryk Wolski
> (a.k.a. Extending.pdf) might be what you're looking for.

Thank you. It speaks directly to this question, and asserts that the first two forms are equivalent. contains makes it a bit easier for the eye to catch that inheritance is happening.



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 Received on Sat Aug 20 08:48:13 2005

This archive was generated by hypermail 2.1.8 : Sun 23 Oct 2005 - 15:37:58 EST