[R] path and R CMD check

Uwe Ligges ligges at statistik.tu-dortmund.de
Fri Jul 25 11:01:09 CEST 2008



Christophe Genolini wrote:
> Hi the list,
> 
> When I developpe my code, I put the file that define all the functions 
> in ./MyPack/R/prog.R and the tests in ./MyPack/tests/testsProg.R
> The test files start by
> 
> load("../data/myData.rda")
> source("../R/prog.R")
> #test function number one...
> 
> But "R CMD check MyPack" does not find the file myData.rda.
> Does someone knows what is wrong ?


Read Writing R Extensions, learn how a package works (and yes, it works 
without sourcing files separately since the package mechanism does the 
job for you) and just say:

library("packagename")
data("myData")

Best wishes,
Uwe Ligges


> Christophe
> 
> ______________________________________________
> R-help at r-project.org mailing list
> https://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide 
> http://www.R-project.org/posting-guide.html
> and provide commented, minimal, self-contained, reproducible code.



More information about the R-help mailing list