Hi,
 
Why doesn't this work?
 
setClass("test",representation(names="character"))
tmp <- new("test")
[EMAIL PROTECTED] <- "a"
 
Error in "slot<-"(object, name, TRUE, value) : 
        'names' attribute [1] must be the same length as the vector [0]
 
Why does this work (replace names with name)?
 
setClass("test",representation(name="character"))
tmp <- new("test")
[EMAIL PROTECTED] <- "a"
 
I looked at the help for setClass, representation, and slot and found no
restriction on the slot names other than that they "be any non-empty string,
but if the name is not made up of letters, numbers, and '"."', it needs to
be quoted".
 
Thanks,
Steve

        [[alternative HTML version deleted]]

______________________________________________
[email protected] mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html

Reply via email to