[Rd] Structure of the object: list() and attr()
Seth Falcon
sfalcon at fhcrc.org
Tue Aug 1 16:00:07 CEST 2006
"Gorjanc Gregor" <Gregor.Gorjanc at bfro.uni-lj.si> writes:
> Hello!
>
> I am writing code where I define objects with new class. When I started,
> it was a simple data.frame with attributes, but it is getting more evolved
> and I would like to hear any pros and cons to go for list structure,
> where one "slot" would be a data.frame, while other "slots" would take over
> role of attributes.
I would suggest using S4 classes for representing more complex
classes.
I don't think a list structure is much different (morally) than a
data.frame with lots of attributes hanging off of it. Either way, the
slots and they types don't share a common definition that can be
checked.
+ seth
More information about the R-devel
mailing list