[Rd] Structure of the object: list() and attr()

2006-08-01 Thread Gorjanc Gregor
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

Re: [Rd] Structure of the object: list() and attr()

2006-08-01 Thread Seth Falcon
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

Re: [Rd] Structure of the object: list() and attr()

2006-08-01 Thread Gabor Grothendieck
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