Skip to content
Prev 43087 / 63424 Next

R-2.15.0 and Exporting Methods Converted To S4 Generic

On 04/13/2012 01:40 AM, Uwe Ligges wrote:
that's not correct.
I think this paradigm is left over from an earlier time; at the time of 
package installation you know that your namespace has access to 
graphics::image, and that graphics::image is not an S4 generic. Also, 
your intention is to make an S4 generic without changing the signature. 
So just

setGeneric("image")

though the more explicit setGeneric is not incorrect, and the 
conditional promotion shouldn't be incorrect either.
conceptually, having created the generic it seems like you should export 
it, but exportMethods will export the generic as well.

Your package actually installs under R-devel, and I wonder if this is a 
manifestation of the bug reported here

https://stat.ethz.ch/pipermail/r-devel/2012-April/063783.html

A work-around seems to be an unconditional setGeneric("image").

Martin