How can I specify the working directory while running R CMD check?
The command R CMD check
runs the R files in th开发者_如何学Goe project's tests directory.
The directory structure:
toplevel
project
R
rmongo.R
tests
RMongo-Ex.R
When I R CMD check
project in toplevel directory, i run into this error:
cannot open file '../R/rmongo.R': No such file or directory
because my test file sources the R code file source('../R/rmongo.R', chdir = TRUE)
How can I make R CMD check
cd into the test directory before running test file?
The files in tests are test against the package after it's built so I just included library('name-of-package') in the test file and it was able to build.
精彩评论