From pgilbert at bank-banque-canada.ca  Wed May 30 19:37:26 2007
From: pgilbert at bank-banque-canada.ca (Paul Gilbert)
Date: Wed, 30 May 2007 13:37:26 -0400
Subject: [Rd] S4 assignment \alias and \usage
In-Reply-To: <m2abvmfety.fsf@ziti.local>
References: <465D7BB2.3050405@bank-banque-canada.ca>	<18013.34742.228595.528262@stat.math.ethz.ch>	<465D937F.80207@bank-banque-canada.ca>
	<m2abvmfety.fsf@ziti.local>
Message-ID: <465DB656.8080104@bank-banque-canada.ca>



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.

Paul
====================================================================================

La version fran?aise suit le texte anglais.

------------------------------------------------------------------------------------

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



[Rd] S4 assignment \alias and \usage
Paul Gilbert