Marc Schwartz <marc_schwartz <at> comcast.net> writes: > > on 02/01/2009 10:45 AM David Winsemius wrote: > > Let me admit at this point that I am not really sure that S4 classes is > > the correct classification of such "@"-using extraction processes. The > > documentation refers to "formal methods" and I don't yet have enough > > knowledge to know that how tightly slots and formal classes are linked > > with S4 or S3. > > David, > > The use of '@' as a slot extractor is specific to S4 methods and you > will actually get an error if attempting to use it on other object > types. As per the Details section of ?"@":
My other two cents about this issue: David is quite right that you can basically think of "@" as equivalent to "$" for getting bits out of S4 objects. However ... in general S4 classes make it harder to get internal bits out of objects, and in some sense they're really *supposed* to make it harder. Really the thing to do when you encounter information that's buried somewhere in an S4 object, the appropriate solution is what you did -- write to the author and say "why isn't there an accessor method [the technical jargon for functions like coef()] to get this piece of information out of this object, or why isn't it properly documented? (Or is there some reason that I shouldn't be trying to access this piece of information?)" cheers Ben Bolker ______________________________________________ R-help@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.