Search code examples
rbuildpackage

check.Renviron being ignored (OSX + R 2.15)


The semester has ended and I'm now bringing some packages up to R 2.15 (I did not want to change them while students were using them). So I'm doing my usual thing, which worked under R 2.14. As far as I can see, the documentation has not changed with respect to any of this, but I may have missed it.

I have edited my package ChemoSpec but when I go to check it, R gives an error about packages required but not available, then lists them. These packages are available, they are in a local directory which is pointed a-:

.libPaths()
[1] "/Users/bryanhanson/R_pkgs"                                      
[2] "/Library/Frameworks/R.framework/Versions/2.15/Resources/library"

The allegedly missing packages are in fact in /Users/bryanhanson/R_pkgs.

I am aware my .Rprofile is skipped by the checking process, so the .libPaths are not being set by .Rprofile Instead, I have a check.Renviron file which is located in /Users/bryanhanson/.R and contains the following lines:

# Bryan's check.Renviron for customizing check environment
# resides in /Users/bryanhanson/.R
R_LIBS = /Users/bryanhanson/R_pkgs

I have tried to check with the following commands in the terminal

R --as-cran CMD check ChemoSpec
R --vanilla CMD check ChemoSpec

The response to each of these is slightly different, but both fail because of not finding the dependencies, because, apparently, R is not looking in /Users/bryanhanson/R_pkgs even though I think I have told it do so.

Any suggestions? It must be something simple.

Here is the sessionInfo():

sessionInfo()
R version 2.15.0 (2012-03-30)
Platform: x86_64-apple-darwin9.8.0/x86_64 (64-bit)

locale:
[1] en_US.UTF-8/en_US.UTF-8/en_US.UTF-8/C/en_US.UTF-8/en_US.UTF-8

attached base packages:
[1] stats     graphics  grDevices utils     datasets  methods   base     

other attached packages:
[1] sos_1.3-1  brew_1.0-6 

Solution

  • The file check.environ seems to be confined to the usage of package rcmdcheck which is an add-on package, so not contained in the base distrubtion of R.

    See ?rcmdcheck::rcmdcheck at the very bottom:

    Note that Config/rcmdcheck/ignore-inconsequential-notes and the check.env file are only supported by rcmdcheck, and running ⁠R CMD check⁠ from a shell (or GUI) will not use them.