[R] Defining class as a member of another class

Gabor Grothendieck ggrothendieck at gmail.com
Sun Jun 28 04:29:49 CEST 2009


Try this:

> setClass("zoo")
[1] "zoo"
> setClass("Work",representation=(x="zoo"))
[1] "Work"


On Sat, Jun 27, 2009 at 10:01 PM, R_help Help<rhelpacc at gmail.com> wrote:
> Hi,
>
> When I define a new class (through setClass), members defined in
> representation argument doesn't seem to like a class. For example, if
> I do the following:
>
> setClass("NotWork",representation=(x="zoo"))
>
> It seems to me that representation members will take in only primitive
> type to R. Is there any way to stuff a class as a member in another
> class? Thank you.
>
> - adschai
>
> ______________________________________________
> R-help at r-project.org 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.
>




More information about the R-help mailing list