开发者

How can I specify the working directory while running R CMD check?

开发者 https://www.devze.com 2023-01-19 07:18 出处:网络
The command R CMD check runs the R files in th开发者_如何学Goe project\'s tests directory. The directory structure:

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.

0

精彩评论

暂无评论...
验证码 换一张
取 消