[R] building packages with NAMESPACE

Uwe Ligges ligges at statistik.uni-dortmund.de
Thu Jul 8 13:49:21 CEST 2004


Meinhard Ploner wrote:

> hi!
> I tried to build a very simple package with NAMESPACE file,
> such that datasets are loaded only dynamically.
> 
>  > a2 <- function(x=a1) x+4
>  > a1 <- 1:10
>  > package.skeleton("aaa", list=c("a1", "a2"))
> 
> Then I modified the help files and added the file NAMESPACE with these 2 
> lines:
> useDynLib(aaa)
> export(a1, a2)

a) Don't export data frames.
b) Don't useDynLib, if there is no library to be used.

=> The correct NAMESPACE file contains not more than the single line

export(a2)


Uwe Ligges


> 
> Then "R CMD BUILD aaa" works fine, but "R CMD CHECK aaa" gives:
> .........
> * checking R files for syntax errors ... OK
> * checking R files for library.dynam ... OK
> * checking S3 generic/method consistency ... WARNING
> Error in .tryQuietly({ : Error in library(package, lib.loc = lib.loc, 
> character.only = TRUE, verbose = FALSE) :
>         package/namespace load failed
> Execution halted
> * checking for replacement functions with final arg not named 'value' 
> ... WARNING
> Error in .tryQuietly({ : Error in library(package, lib.loc = lib.loc, 
> character.only = TRUE, verbose = FALSE) :
>         package/namespace load failed
> Execution halted
> 
> Without NAMESPACE file there wasn't any error, so anybody could help me?
> Thanks
> Meinhard Ploner
> 
> 
> PS: version
>          _
> platform powerpc-apple-darwin7.2.0
> arch     powerpc
> os       darwin7.2.0
> system   powerpc, darwin7.2.0
> status
> major    1
> minor    8.1
> year     2003
> month    11
> day      21
> language R
> 
> ______________________________________________
> R-help at stat.math.ethz.ch mailing list
> https://www.stat.math.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide! 
> http://www.R-project.org/posting-guide.html




More information about the R-help mailing list