Skip to content

[Bioc-devel] NAMESPACE problem in globaltest, widgetTools and SAGElyzer

2 messages · Goeman, J.J. (MSTAT), Seth Falcon

#
Dear BioC developers,

I've been trying to add a NAMESPACE to my globaltest package, but I get an error message when I run Rcmd check (R 2.2.0, WinXP) that I do not understand.

This error happens to be exactly the same that I see in the package check results of the widgetTools package (1.7 release, solaris only)

http://www.bioconductor.org/checkResults/1.7/SunOS-sun4u/widgetTools

The same seems to happen in SAGElyzer (1.7 release, windows only):

http://www.bioconductor.org/checkResults/1.7/Windows/SAGElyzer

I also see that in both packages, the problem occurs only in the 1.7 release, and not on devel. 

Does anybody (Jianhua?) know the origin of this error? I have no clue as to the cause of this error in my own package. It even occurs when I use a  NAMESPACE with only one line

useDynLib(globaltest)

However, when I remove the namespace file altogether, Rcmd check completes without errors.

I would be grateful for any help.

Jelle


Below is the error I get in globaltest when running Rcmd check. I ran Rcmd INSTALL first, which completed without errors. My NAMESPACE file is given at the bottom of this email.

The strangest part of the error message is the message: "In R, the argument of a replacement function which corresponds to the right hand side must be named 'value'." I have only one replacement function, which is correctly formulated and passes Rcmd check without problems if I have no NAMESPACE file.

* using log directory 'C://globaltest.Rcheck'
* using R version 2.2.0, 2005-10-06 
* checking for file 'globaltest/DESCRIPTION' ... OK
* this is package 'globaltest' version '3.3.1'
* checking if this is a source package ... OK
* checking package directory ... OK
* checking for portable file names ... OK
* checking DESCRIPTION meta-information ... OK
* checking package dependencies ... 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 'globaltest'
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 'globaltest'
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 'globaltest'
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 Rd files ... OK
* checking for missing documentation entries ... ERROR
Error: package/namespace load failed for 'globaltest'


And here's the content of my MAMESPACE file:


useDynLib(globaltest)

importFrom(graphics, plot)

exportClasses(gt.result, gt.barplot)

exportMethods("[", show, result, p.value, length, names, "names<-", sort, hist, z.score, scale, plot)

export(globaltest, permutations, sampling, geneplot, sampleplot, regressionplot, checkerboard)
#
Hi Jelle,

Thanks for working on adding a NAMESPACE!
On 24 Nov 2005, J.J.Goeman at lumc.nl wrote:
Well, from here, it doesn't look like globaltest has any C or Fortran
code and so there is no globaltest dynamic library to load.  You only
need to use the useDynLib directive in the NAMESPACE file if your
package contains C code.
If you then started R and did library(globaltest) I think you
would have seen a message about not being able to load the dyn lib.
Certainly, the error messages could be *much* more helpful :-)
Works for me after removing the useDynLib line.

A few other things you will want to do:

1. Since you use S4 classes and methods, add a .onLoad function as
   described in the Writing R Extensions manual:

   .onLoad <- function(lib, pkg) require("methods")

2. Consider adding SaveImage: yes to DESCRIPTION

3. Don't forget to svn add the NAMESPACE file :-)


Best,

+ seth