Hi Kevin,
Thanks for your reply.
Your reply makes sense. Truthfully, I didn't fully understand these consequences '--vanilla' option. Removing the '--vanilla' option from the code that checks for existence of pROC didn't work - ROCker still can't find the pROC package. Moving to your next suggestions, I've read up a bit this morning on setting R_LIBS. Not quite sure how to proceed.
I learned this from
cgillespie's Efficient R Programming: "
It is important to know the location of the .Rprofile
and .Renviron
set-up files that are being used out of these three options. R only uses one .Rprofile
and one .Renviron
in any session: if you have a .Rprofile
file in your current project, R will ignore .Rprofile
in R_HOME
and HOME
. Likewise, .Rprofile
in HOME
overrides .Rprofile
in R_HOME
. The same applies to .Renviron
: you should remember that adding project specific environment variables with .Renviron
will de-activate other .Renviron
files."So I guess the problem is that ROCker is either a) ignoring all the .Rprofiles because of the --vanilla option (although removing that doesn't fix it), or b) only looking a specific place for the .Rprofile, or c) something else. C Gillespie warns against changing the "main" .Rprofile(s) (i.e.the ones in R_HOME and HOME), but if ROCker can only see these then I guess I have to try that. I'm just adding a lib path and I can always remove it. However, all I have is the default R_HOME/etc/.Rprofile_site. My R_PROFILE and R_PROFILE_USER environment variables are unset. I don't know if I should set one of them to include R_LIBS=/path/to/packrat/library/tool. If so, I will need to do some research to find an example of what else it should contain. Do you think this is the right path forward? I don't think I should change my default .Rprofile_site file.
Another thing I'm unclear on (regarding Packrat): no matter what my working directory is, .libPaths() always includes only the Packrat library. I expected the value of .libPaths() to change based on my current working directory: when I'm inside my Packrat project location, I expect it to see the local project .Rprofile (and Packrat library location). Outside of that, I expect it to default to the library location specified in .Rprofile_site. See below (I added my comments with hashtags after pasting it below):
# Location of my project
> getwd()
[1] "/home/data/rocker"
> .libPaths()
[1] "/home/data/rocker/packrat/lib/x86_64-pc-linux-gnu/3.2.3"
[2] "/home/data/rocker/packrat/lib-ext/x86_64-pc-linux-gnu/3.2.3"
[3] "/home/data/rocker/packrat/lib-R/x86_64-pc-linux-gnu/3.2.3"
# Change location to project's parent directory
> setwd("/home/data")
> getwd()
[1] "/home/data"
# Library path location is still the same
> .libPaths()
[1] "/home/data/rocker/packrat/lib/x86_64-pc-linux-gnu/3.2.3"
[2] "/home/data/rocker/packrat/lib-ext/x86_64-pc-linux-gnu/3.2.3"
[3] "/home/data/rocker/packrat/lib-R/x86_64-pc-linux-gnu/3.2.3"
# Try setting it to a totally different directory
> setwd("/home/src/")
> getwd()
[1] "/home/src"
# Library location is still the same
> .libPaths()
[1] "/home/data/rocker/packrat/lib/x86_64-pc-linux-gnu/3.2.3"
[2] "/home/data/rocker/packrat/lib-ext/x86_64-pc-linux-gnu/3.2.3"
[3] "/home/data/rocker/packrat/lib-R/x86_64-pc-linux-gnu/3.2.3"
What don't I understand about how Packrat functions? (This seems unrelated, but I suspect understanding Packrat better might help me troubleshoot my main problem).
Thank you again.