[Rd] checking S3 generic/method consistency

Paul Gilbert pgilbert at bank-banque-canada.ca
Mon Oct 17 16:21:31 CEST 2005


Ok, but I'm still confused about what "as seen from the package" means. 
I'm especially confused because at first in my testing (on Linux) a 
method (in a package not in dse but using dse1) was being compared 
against the stats generic, so I put in a work around. Then I discovered 
in Solaris the comparison was made against the generic in dse1. And now, 
after some further ongoing development I find that in some of my 
packages in Linux it is compared against the dse1 generic, and I can't 
see what is different between the ones compared with dse1 and the ones 
compared with stats. This is all with the released version of R-2.2.0. I 
can't figure out what changes this, but I'm not even sure where to start 
looking. Is the package's view determined by its NAMESPACE, Depends in 
the DESCRIPTION file, or if there is requires() in the .onLoad will that 
override? This is all with a fairly "clean" test environment. What 
happens when other packages are attached? Where/how does it break when 
there are other packages attached that need conflicting generics (or can 
that actually work)?


Kurt Hornik wrote:
>>>>>>Paul Gilbert writes:
>>In R-2.2.0,  how does   "checking S3 generic/method consistency"  
>>determine which generic to check against when there are two?  I have a 
>>generic "simulate" in dse1 and there is a new generic "simulate" in 
>>stats, and I don't seem to be able to get  my simulate methods to be 
>>checked consistently against one or the other. Is this deteremined by 
>>Depends in the DESCRIPTION file, the NAMESPACE, or something else?
> It is attempted to use the generic "as seen from the package".
> Actually, I made a code change to get things right for dse ...
> -k

More information about the R-devel mailing list