[Rd] S4 assignment \alias and \usage

Paul Gilbert pgilbert at bank-banque-canada.ca
Wed May 30 19:37:26 CEST 2007

Seth Falcon wrote:
> Paul Gilbert <pgilbert at bank-banque-canada.ca> writes:
>> Let me back up a bit, I may be making another mistake.  My code has
>> setGeneric("TSdoc<-",
>>    def= function(x, value) standardGeneric("TSdoc<-"),
>>    useAsDefault= function (x, value) {attr(x, "TSdoc") <- value ; x })
>> setGeneric("TSdoc",
>>    def= function(x) standardGeneric("TSdoc"),
>>    useAsDefault= function(x) attr(x, "TSdoc"))
> Aside:
> It seems odd to me to define such defaults.  How do you know x is
> going to have a TSdoc attribute?  

attr returns NULL if the attibute does not exist so, in my S3 way of 
thinking, it seems very natural. Now knowing only a very little about S4 
classes, I can see you might think it is odd.


La version française suit le texte anglais.


This email may contain privileged and/or confidential inform...{{dropped}}

More information about the R-devel mailing list