Skip to content
Prev 2773 / 12125 Next

[R-pkg-devel] Courtesy methods and explosive dependencies

On 25/05/2018 11:38 AM, Lenth, Russell V wrote:
There can't really be an "ImportGenerics", because S3 is so informal.  A 
generic function is a function that calls UseMethod, but it can do 
anything else as well.  So R would need some fancy code analysis to know 
whether it was safe to import the generic but not all the dependencies 
of that package, and that could change when the package holding the 
generic was updated.

Examples of generics that do more than simply call UseMethod are rare, 
but they exist:  as.data.frame() and sort() are a couple.

Duncan Murdoch