Skip to content
Prev 70341 / 398506 Next

S4 method inheritance

Ross Boylan wrote:
Well, more that you can identify one (either explicitly by its package 
[ie. fully-qualified name], or implicitly by the fact that it is first 
on the search path - the former being prefered). But the notion is that 
there is one and you have asked that your method be made available to 
that one generic function for dispatch. This is in contrast to S3 - 
where no such functionality exists - that I know of; under S3 any method 
is a method for all generic functions of the correct name and the 
programmer has no (easy) control. Under S4 methods are not really 
ordinary functions, should not be called directly and are invoked only 
via calls to the generic (you can of course break all of those rules).
I believe that is the documented behavior. Yes the where argument 
should allow you complete specificity. I will leave it to the auther to 
clarify differences between the where and package arguments in the call 
to setGeneric (or you, if you care to explore the code).
It is the two packages. The S langauge allows for the same symbol to 
be bound to different values in different namespaces (in R that is 
becoming explicit, in SPlus it is less so, but still generally true). I 
can think of no good reason to treat generic functions, or any other 
first class object, differently.

HTH,
  Robert
functions and associate them with a