Using the '@' operator, I am able to extract a 'names' attribute  
assigned to a formal object.
However, I can not use the replacement form ('@<-') to assign that  
attribute.

 > setClass("foo", representation("numeric"))
[1] "foo"
 > (new("foo", 1:4)->a)
An object of class “foo”
[1] 1 2 3 4
 > names(a) <- LETTERS[1:4]
 > [EMAIL PROTECTED]
[1] "A" "B" "C" "D"
 > [EMAIL PROTECTED] <- LETTERS[5:8]
Error in checkSlotAssignment(object, name, value) :
        "names" is not a slot in class "foo"

I don't know that this asymmetry will ever cause a problem, but I  
just wanted to note it because it appears from the help pages
'slot {methods}'  and 'slotOp {base}' that the '@' operator is only  
intended to provide access to defined slots.

I am still on R 2.2.1.

______________________________________________
R-devel@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-devel

Reply via email to