[R] vague errors on R CMD check for very minimal S4-style package

Prof Brian Ripley ripley at stats.ox.ac.uk
Wed Jun 7 08:51:59 CEST 2006


This is an S4-using package but missing a dependence on 'methods'.

To run R CMD check the package has to load under minimal conditions, e.g.

R_DEFAULT_PACKAGES=NULL R
...
> library(foo)

should work.  'methods' is quite expensive to load, and so is only used in 
checking if explicitly requested.

On Tue, 6 Jun 2006, Seth Falcon wrote:

> "Roels, Steven" <Steven.Roels at mpi.com> writes:
>
>> Hello,
>>
>> I have a very minimal package "simplepkg" (DESCRIPTION, NAMESPACE, and
>> R) with S4 classes/methods (defines a class "foo" and a show method for
>> that class" - both the class and show method are exported).  I can
>> seemingly install the package, then load and use it:
>>
>> Error: package/namespace load failed for 'simplepkg'
>> Call sequence:
>> 2: stop(gettextf("package/namespace load failed for '%s'",
>> libraryPkgName(package)),
>>        call. = FALSE, domain = NA)
>> 1: library(package, lib.loc = lib.loc, character.only = TRUE, verbose =
>> FALSE)
>> Execution halted
>
>>
>> Here are the file contents:
>> -------------------------------
>>
>> sun890% cat DESCRIPTION
>> Package: simplepkg
>> Type: Package
>> Title: Does stuff
>> Version: 0.1-1
>> Date: 2006-06-06
>> Author: Me
>> Maintainer: Also Me <me at here.com>
>> Description: Does interesting stuff
>> License: GPL
>
> Try adding LazyLoad: yes to DESCRIPTION (or SaveImage: yes).
>
And

Depends: methods

Package stats4 is provided in part as an example of a small S4-using 
package for people to copy.

-- 
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-help mailing list