Skip to content
Prev 9760 / 63421 Next

R CMD check: is it error to setMethod for class not currently defined?

[R CMD check by itself definitely does not test for this.]
Why should it?  Packages could have an object called last.warning in
their environment---the last.warning created by warning() seems to end
up in .GlobalEnv ...

What seems to happen is that you have a package installed as a save
image which at save time creates a warning and hence last.warning in
.GlobalEnv.  The way installing as a save image works everything in
.GlobalEnv gets included in the package environment.  If for some reason
this produces something 'unwanted', it can still be removed e.g. from
inside the package load hook(s) (e.g., your .First.lib()).  The QC
tools, when working on installed packages, simply load and attach them,
and perform computations on what is available then.

Best
-k