From szehnder at uni-bonn.de  Fri Nov  8 10:51:24 2013
From: szehnder at uni-bonn.de (Simon Zehnder)
Date: Fri, 8 Nov 2013 10:51:24 +0100
Subject: [Rd] R CMD INSTALL - problem with working directory
Message-ID: <0F3BFD85-4E89-43ED-8F25-6013EFE75630@uni-bonn.de>

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



[Rd] R CMD INSTALL - problem with working directory
Simon Zehnder