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 ?"@":

As from R 2.7.0 it is checked that object is an S4 object (see isS4),
and as from R 2.8.0 it is an error to attempt to use @ on any other
object. (There is an exception for name .Data for internal use only.)



There are some good references on S4 methods in the wiki if you wish to
read further:

 http://wiki.r-project.org/rwiki/doku.php?id=tips:classes-s4

HTH,

Marc Schwartz

______________________________________________
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.

Reply via email to