Skip to content
Prev 41498 / 63421 Next

.onLoad failing because could not find function "loadMethod"

The thing that happens during the check is that the methods package is 
not among the automatically loaded and attached packages.

When the pkgB packages is attached, the Namespaces of pkgA and methods 
are loaded but not attached.

Note that one of the checks tells you:

"A namespace must be able to be loaded with just the base namespace
loaded: otherwise if the namespace gets loaded by a saved object, the
session will be unable to start."


If you like to see into the details more easily, just start R with

R  R_DEFAULT_PACKAGES=NULL
and then try to
  library("pkgB")
and you are able to reproduce the check messages.

You can avoid n-1 Warnings/Errors in the checks by adding
library("methods")
in your .onLoad function, but of course you cannot get rid of the check 
that checks that the package can be loaded with the base namespace only.

Best,
Uwe Ligges
On 15.10.2011 02:46, Herv? Pag?s wrote: