set $R_LIBS_SITE rather than $R_LIBS when installing R packages#2326
Conversation
…defined libraries before site installed ones. The order is: R_LIBS, R_LIBS_USER, R_LIBS_SITE. And the R install.packages only ever considers the first entry in the library path unless you explicitly specify a lib= to install to.
lexming
left a comment
There was a problem hiding this comment.
I agree with this change. I would just add an option to go back to the previous behaviour, in case there are unforeseen issues with the change to R_LIBS_SITE. So that users can easily opt-out. Please check my PR akesandgren#11
|
@boegel thoughts on that change? I don't really think it is needed, it won't hurt of course but in the long run we shouldn't need it... |
|
Hmm, not quite sure about this one... In some sense it's a bug fix, but it's also a backwards-incompatible change, sort of. @fizwit Any feedback on this proposed change? You probably have more experience with |
|
@boegel I have to agree with @akesandgren , setting R_LIBS_SITE for R bundle is better than using R_LIBS. It is not a hack and is the correct way to add to the R search Path. The exact issue you mention happens at our site and creates at least one ticket per week. Using install.packages() without specifying lib=path results in an error. My local site documentation directs users to put the following in there .Rprofile. If this is not a hack then I don't know what is. I will reserve a separate Rant about how RStudio-Server completely ignores R_LIBS fand R_LIBS_SITE for a later time. Using R_LIBS_SITE for R bundles would be my preference. |
|
Huh! I went and looked at the documentation,
I don't recall from before that '(not recommended)' being there, but I've been reading various versions of this since the 90s, and I wouldn't have a clue when it got introduced. The main question is whether this PR should be modified in light of that recommendation by the R developers? |
|
We can't really do that. |
|
Test report by @boegelbot Overview of tested easyconfigs (in order)
Build succeeded for 5 out of 5 (5 easyconfigs in total) |
(created using
eb --new-pr)Use R_LIBS_SITE when installing RPackages. This makes R pick up user defined libraries before site installed ones. The order is: R_LIBS, R_LIBS_USER, R_LIBS_SITE. And the R install.packages only ever considers the first entry in the library path unless you explicitly specify a lib= to install to.
Fixes #2200