[R] Rcmd check does not recognize formal generic function as code object

Gordon Smyth smyth at wehi.edu.au
Sat Feb 22 14:28:08 CET 2003


At 04:16 PM 19/02/2003, Robert Gentleman wrote:
>   It was decided that should not be an error to omit documentation for
>   a generic function defined in a package (whose sole purpose is to
>   extend a current function to be generic). It appears that the
>   implementation of that decision was to treat all generic functions
>   in packages as non-entities. That is probably not the best and one
>   can argue that there should be no warning if a generic is documented
>   (nor one if it isn't and there is already documentation for it
>   somewhere).

Actually methods are also treated as non-entities, unless they are actually 
assigned into a function name, which the setMethod function does not do in 
itself nor require. This seems wrong - it should definitely be considered a 
mistake to define a new method using setMethod and not document it. Such 
documentation cannot occur in the .Rd file belonging to the class that it 
operates on if that class is defined in a different package.

Classes defined using setClass are similarly treated an non-entities. It 
seems that rcmd check is largely "unaware" of formal methods and classes.

Regards
Gordon




More information about the R-help mailing list