Carlos J. Gil Bellosta
2007-Mar-05 11:20 UTC
[R] Error loading a dependency in a package: missing namespace?
Dear r-helpers, I am building a package that depends on some others. I recently added a new dependency: package "outliers". But does not work any more. Let me show some information below: carlos at kropotkin:pcrAnalysis$ cat DESCRIPTION Package: pcrAnalysis Type: Package Title: pcrAnalysis Version: 0.7.2 Date: 2007-02-27 Depends: Biobase, methods, outliers Author: Carlos J. Gil Bellosta <gilbellosta at gmail.com> Maintainer: Carlos J. Gil Bellosta <gilbellosta at gmail.com> Description: Package for the analysis of Taqman experiments License: TBA carlos at kropotkin:pcrAnalysis$ cat NAMESPACE import(methods, Biobase, outliers) exportPattern("^tqmn") exportClasses("pcrExprSet") exportMethods(task, "task<-", phenoData.sort) But now, the load of the packages fails. If I try to run carlos at kropotkin:tmp$ R CMD check pcrAnalysis I get the following log: * checking for working latex ... OK * using log directory '/tmp/pcrAnalysis.Rcheck' * using R version 2.4.1 (2006-12-18) * checking for file 'pcrAnalysis/DESCRIPTION' ... OK * checking extension type ... Package * this is package 'pcrAnalysis' version '0.7.2' * checking package dependencies ... OK * checking if this is a source package ... OK * checking whether package 'pcrAnalysis' 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 whether the package can be loaded ... ERROR Loading required package: Biobase Loading required package: tools Welcome to Bioconductor Vignettes contain introductory material. To view, type 'openVignette()' or start with 'help(Biobase)'. For details on reading vignettes, see the openVignette help page. Loading required package: outliers Error in loadNamespace(package, c(which.lib.loc, lib.loc), keep.source = keep.source) : in 'pcrAnalysis' classes for export not defined: pcrExprSet In addition: Warning message: package 'pcrAnalysis' contains no R code in: loadNamespace(package, c(which.lib.loc, lib.loc), keep.source = keep.source) Error: package/namespace load failed for 'pcrAnalysis' Execution halted It seems that the error is related to something having to do with namespaces. The thing is that package "outliers" does not have a NAMESPACE file. Could this be an issue? I have contacted the author of the package and he sais that "outliers" has been used in another package, "quantchem" (also in CRAN). However, "quantchem" does not have a "NAMESPACE" file either. I have been looking for information on how the loadNamespace function works and even looking at its code. But can anybody give me a clue? Would the "outliers" package require a "NAMESPACE" file? By the way, I have contacted the author of the package and he has been quite helpful, but he says he feels that that (lack of this file) may not be causing the problem. And I am using R version 2.4.1 (2006-12-18) on an Ubuntu Edgy (6.10) box. Regards, Carlos J. Gil Bellosta http://www.datanalytics.com
Seth Falcon
2007-Mar-05 17:15 UTC
[R] Error loading a dependency in a package: missing namespace?
"Carlos J. Gil Bellosta " <cgb at datanalytics.com> writes:> import(methods, Biobase, outliers)> * checking whether the package can be loaded ... ERROR > Loading required package: Biobase > Loading required package: tools > > Welcome to Bioconductor > > Vignettes contain introductory material. To view, type > 'openVignette()' or start with 'help(Biobase)'. For details > on reading vignettes, see the openVignette help page. > > Loading required package: outliers > Error in loadNamespace(package, c(which.lib.loc, lib.loc), keep.source > = keep.source) : > in 'pcrAnalysis' classes for export not defined: pcrExprSet > In addition: Warning message: > package 'pcrAnalysis' contains no R code in: loadNamespace(package, > c(which.lib.loc, lib.loc), keep.source = keep.source) > Error: package/namespace load failed for 'pcrAnalysis' > Execution halted > > It seems that the error is related to something having to do with > namespaces. The thing is that package "outliers" does not have a > NAMESPACE file. Could this be an issue?Yes, you cannot do import(pkg) in the NAMESPACE file if pkg doesn't itself have a NAMESPACE file. So try just removing that from your NAMESPACE file. + seth -- Seth Falcon | Computational Biology | Fred Hutchinson Cancer Research Center http://bioconductor.org