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

Rajarshi Guha rguha at indiana.edu
Thu Aug 9 23:27:29 CEST 2007

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

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

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.

More information about the R-help mailing list