[Rd] R CMD INSTALL - problem with working directory

Simon Zehnder szehnder at uni-bonn.de
Fri Nov 8 10:51:24 CET 2013


Dear R-Devels,

I installed on my Mac OS X 10.9 system several R-3.0.2 versions, differing by the compiler used to build R. I can load them via my environment-modules. 

Now, what I want to have is for each version an own working directory such that .RData and .Rhistory are not loaded from a different version. I did that by adding setwd(“~/Library/R/R-gcc") to my Rprofile.site. This works fine, when I call R and work inside of it. 

Though when testing my own packages, I need R CMD INSTALL and this does not work when not called from the set working directory, i.e. for the example above ~/Library/R/R-gcc. If I am not in this directory I get the well-known issue

Warning: invalid package ‘pkg/’
Error: ERROR: no packages specified

Instead, calling R CMD INSTALL from ~/Library/R/R-gcc works fine. 

I checked the permissions on ~/Library/R/R-gcc in R. These seem to be fine to me:

system("ls -hFGlxo /Users/simonzehnder/Library/R/R-gcc")
total 0
drwxr-xr-x  7 simonzehnder   238B Nov  8 10:37 library/

R CMD INSTALL seems to need a working directory that equals the actual working directory. Is there a workaround, that makes things work for me?

Best

Simon



More information about the R-devel mailing list