[R] S4 based package giving strange error at install time, but not at check time

Prof Brian Ripley ripley at stats.ox.ac.uk
Thu Aug 9 23:48:30 CEST 2007


On Thu, 9 Aug 2007, Rajarshi Guha wrote:

> Hi, I have a S4 based package package that was loading fine on R
> 2.5.0 on both OS X and
> Linux. I was checking the package against 2.5.1 and doing R CMD check
> does not give any warnings. So I next built the package and installed
> it. Though the package installed fine I noticed the following message:
>
> Loading required package: methods
> Error in loadNamespace(package, c(which.lib.loc, lib.loc),
> keep.source = keep.source) :
>         in 'fingerprint' methods specified for export, but none
> defined: fold, euc.vector, distance, random.fingerprint,
> as.character, length, show
> During startup - Warning message:
> package fingerprint in options("defaultPackages") was not found
   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

Do you have this package in your startup files or the environment variable 
R_DEFAULT_PACKAGES?  R CMD check should not look there: whatever you are 
quoting above seems to.

> However, I can load the package in R with no errors being reported and
> it seems that the functions are working fine.
>
> Looking at the sources I see that my NAMESPACES file contains the
> following:
>
> importFrom("methods")

That should specify what to import, or be imports("methods").  See 
'Writing R Extensions'.

> exportClasses("fingerprint")
> exportMethods("fold", "euc.vector", "distance", "random.fingerprint",
> "as.character", "length", "show")
> export("fp.sim.matrix", "fp.to.matrix", "fp.factor.matrix",
> "fp.read.to.matrix", "fp.read", "moe.lf", "bci.lf", "cdk.lf")
>
> and all the exported methods are defined. As an example consider the
> 'fold' method. It's defined as
>
> setGeneric("fold", function(fp) standardGeneric("fold"))
> setMethod("fold", "fingerprint",
>           function(fp) {
>             ## code for the function snipped
>           })
>
> Since the method has been defined I can't see why I should see the
> error during install time, but nothing when the package is checked.
>
> Any pointers would be appreciated.
>
> -------------------------------------------------------------------
> Rajarshi Guha  <rguha at indiana.edu>
> GPG Fingerprint: 0CCA 8EE2 2EEB 25E2 AB04  06F7 1BB9 E634 9B87 56EE
> -------------------------------------------------------------------
> Bus error -- driver executed.
>
> ______________________________________________
> R-help at stat.math.ethz.ch mailing list
> https://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
> and provide commented, minimal, self-contained, reproducible code.
>

-- 
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