-
Notifications
You must be signed in to change notification settings - Fork 284
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
R package modules have priority over user-installed packages #2200
Comments
Current state:
Swapping the variables to use
|
Has the behaviour always been like this? We could maintain backwards compatibility by putting in a version check on which envvar to use (but I wonder if that is overkill). @boegel I can't see a reason why we wouldn't do this. |
This is clearly something that should be fixed. Does anyone have any objections to changing this? |
And at least R/3.5.1 and forward has this behaviour. |
R has multiple variables that control the library path,
R_LIBS
,R_LIBS_USER
andR_LIBS_SITE
.The path can be inspected with
.libPaths()
and is made up of in order of the entries inR_LIBS
,R_LIBS_USER
andR_LIBS_SITE
and last the R installation itself.Our R package modules currently prepend their path to
R_LIBS
similar to howPYTHONPATH
is handled, but this means that the user's directory (typically specified in~/.Renviron
or the default) is not at the front of the library path.This means that users cannot override system-installed packages and more importantly,
install.packages
only ever considers the first entry in the library path unless you explicitly specify alib=
to install to. Some installation functions likeinstall_github
doesn't even have that customization point.I suggest that we alter our R packages to prepend to
R_LIBS_SITE
instead, it seems to yield the preferred order for an end-user.Our R installations do not have a bundled
site-library
directory so the environment variable is currently unused.Upstream documentation on how the paths are constructed: https://stat.ethz.ch/R-manual/R-devel/library/base/html/libPaths.html
The text was updated successfully, but these errors were encountered: