Skip to content
Prev 47906 / 63424 Next

Conflicting definitions for function redefined as S4 generics

On 26/03/2014, 9:13 AM, Gabriel Becker wrote:
I don't think R should base the decision on the signature.

There are two very different situations where this might come up.  In 
one, package A and package B might both define a generic named foo() 
that happens to have the same signature, but with nothing in common. 
That should be allowed, and should behave the same as when they both 
create functions with the same name:  it should be up to the user to 
specify which generic is being called.  If R merged the two generics 
into one, there would be chaos.

The other situation is more likely to apply to this case.  It sounds as 
though both apcluster and BiocGenerics are creating a sort() generic by 
promoting the base package S3 generic into an S4 generic.  Clearly they 
should not be creating separate generics, there's just one.

I don't know if there's something wrong with the way apcluster or 
BiocGenerics are doing things, or something wrong with the way the 
methods package is creating the generic, but it sure looks like a bug 
somewhere.

Duncan Murdoch