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

Roels, Steven Steven.Roels at mpi.com
Tue Jun 6 22:52:58 CEST 2006


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:

> sessionInfo()
Version 2.3.1 (2006-06-01) 
sparc-sun-solaris2.10 

attached base packages:
[1] "methods"   "stats"     "graphics"  "grDevices" "utils"
"datasets"  "base"     

> library(simplepkg,lib.loc="/home/roels/R/lib")
> 
> getClass("foo")

Slots:
                          
Name:       name       age
Class: character   numeric
> 
> myfoo <- new("foo",name="abc",age=10)
> myfoo
I am  abc 
>

But when I do R CMD check, it fails (or perhaps the "errors" are really
"warnings"??):
---------------------------------------

sun890% R CMD check simplepkg 
* checking for working latex ... OK
* using log directory '/home/roels/R/dev/simplepkg/simplepkg.Rcheck'
* using Version 2.3.1 (2006-06-01)
* checking for file 'simplepkg/DESCRIPTION' ... OK
* checking extension type ... Package
* this is package 'simplepkg' version '0.1-1'
* checking package dependencies ... OK
* checking if this is a source package ... OK
* checking whether package 'simplepkg' can be installed ... OK
* checking package directory ... OK
* checking for portable file names ... OK
* checking for sufficient/correct file permissions ... OK
* checking DESCRIPTION meta-information ... OK
* checking top-level files ... OK
* checking index information ... OK
* checking package subdirectories ... OK
* checking R files for syntax errors ... OK
* checking R files for library.dynam ... OK
* checking S3 generic/method consistency ... WARNING
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
See section 'Generic functions and methods' of the 'Writing R
Extensions'
manual.
* checking replacement functions ... WARNING
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
In R, the argument of a replacement function which corresponds to the
right
hand side must be named 'value'.
* checking foreign function calls ... WARNING
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
See section 'System and foreign language interfaces' of the 'Writing R
Extensions' manual.
* checking for missing documentation entries ... ERROR
Error: package/namespace load failed for 'simplepkg'


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

sun890% cat NAMESPACE 
exportClasses("foo")
exportMethods("show")

### cat simplepkg.R  #class def and show method
 
setClass("foo",representation(name="character",age="numeric"))

setMethod("show", "foo", function(object) cat("I am
",object at name,"\n",sep=" "))

### cat zzz.R        # required .onLoad  for use of S4-style
classes/methods
.onLoad <- function(lib,pkg) require(methods)





As I said, the package "seems" to work, but I wanted to be sure I wasn't
missing something that was going to come back to bite me later.

Thanks,

-Steve



*****************************************************************
Steve Roels, Ph.D.                       
Senior Scientist I
Computational Biology               
Millennium Pharmaceuticals, Inc
640 Memorial Drive                 
Cambridge, MA 02139-4815
*****************************************************************





This e-mail, including any attachments, is a confidential business communication, and may contain information that is confidential, proprietary and/or privileged.  This e-mail is intended only for the individual(s) to whom it is addressed, and may not be saved, copied, printed, disclosed or used by anyone else.  If you are not the(an) intended recipient, please immediately delete this e-mail from your computer system and notify the sender.  Thank you.



More information about the R-help mailing list