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
Gorjanc Gregor [EMAIL PROTECTED] 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
The key issue is inheritance. If you use a data frame with attributes then
you can inherit data frame methods without further definition,
e.g.
x - structure(data.frame(a = 1:10), my.attr = 33,
class = c(myclass, data.frame))
dim(x) # inherit dim method
but if you do it this way