From fparlamis at mac.com  Thu May 11 20:53:56 2006
From: fparlamis at mac.com (Parlamis Franklin)
Date: Thu, 11 May 2006 08:53:56 -1000
Subject: [Rd] @ accesses attributes, not just formal slots ?
Message-ID: <C413B816-C6F7-498E-9145-7BB66AF5E921@mac.com>

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]
 > a at names
[1] "A" "B" "C" "D"
 > a at names <- 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.



[Rd] @ accesses attributes, not just formal slots ?
Parlamis Franklin