Skip to content
Prev 47054 / 63424 Next

advise on Depends

Software generated in methods for user classes calls functions in the methods package, as I said.  I don't  know the circumstances (if any) when such calls fail to find functions if  the whole package is  imported.   Perhaps someone on this list may have examples.

But for sure just importing the functions your package calls during installation (setClass(), setMethod(), etc.) won't always be enough.

When the S4 classes and methods were implemented in R in the early 2000s, it was assumed that the methods package would be considered part of the system, as the analogous code was in S.  

It would be nice to either have the package included in Rscript, CMD check, etc. or for some enterprising and very thorough person to go through and bullet-proof the generated code for the absence of the package from the search list.

Absent either of those, the defensive approach is to put methods in Depends.   Or at least, import the package rather than just the obvious functions.

John
On Oct 25, 2013, at 3:46 PM, Paul Gilbert <pgilbert902 at gmail.com> wrote: