[Rd] checking whether the name space can be loaded with stated dependencies

Prof Brian Ripley ripley at stats.ox.ac.uk
Fri Jan 4 10:08:49 CET 2008


What it is trying is

% env R_DEFAULT_PACKAGES=NULL R

> loadNamespace("ggplot2")

The test is not new, so it would seem to be a change in ggplot2 since the 
version on CRAN.  My guess is the your package is doing top-level 
computations, which `Writing R Extensions' warns against:

   The R code files should only create R objects and not call functions
   with side effects such as require and options.

If you must deviate from that, you need to arrange for the environment you 
need: when loading a name space the Depends: packages are not loaded.

On Thu, 3 Jan 2008, hadley wickham wrote:

> Can any one provide more details on this error that I'm getting from R
> CMD check:
>
> * checking whether the name space can be loaded with stated
> dependencies ... WARNING
> Error in eval(expr, envir, enclos) : could not find function "proto"
> Error: unable to load R code in package 'ggplot2'
> Execution halted
>
> 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.
>
> Probably some imports need to be declared in the NAMESPACE file.
>
>
> It's only occurred recently and I have no idea what might have caused
> the change.  The function proto is from the proto package which does
> not have a namespace.
>
> Thanks,
>
> Hadley
>
>
>

-- 
Brian D. Ripley,                  ripley at stats.ox.ac.uk
Professor of Applied Statistics,  http://www.stats.ox.ac.uk/~ripley/
University of Oxford,             Tel:  +44 1865 272861 (self)
1 South Parks Road,                     +44 1865 272866 (PA)
Oxford OX1 3TG, UK                Fax:  +44 1865 272595



More information about the R-devel mailing list