remove custom definition of R_LIBS in scripts/install_R_source.sh#866
remove custom definition of R_LIBS in scripts/install_R_source.sh#866michaelmayer2 wants to merge 1 commit intorocker-org:masterfrom
Conversation
| chmod g+ws "${R_HOME}/site-library" | ||
|
|
||
| ## Fix library path | ||
| echo "R_LIBS=\${R_LIBS-'${R_HOME}/site-library:${R_HOME}/library'}" >>"${R_HOME}/etc/Renviron.site" |
There was a problem hiding this comment.
Sorry I haven't caught up with the discussion, but do we need to remove this instead of changing the order?
There was a problem hiding this comment.
I also fear (based on mere eyeballing) that the current definition may be quite right. It's not easy to get this right for all cases. I also think R prefers use of R_LIBS_SITE. In Renviron (for the Debian package) I now set
# edd Apr 2003 Allow local install in /usr/local, also add a directory for
# Debian packaged CRAN packages, and finally the default dir
# edd Jul 2007 Now use R_LIBS_SITE, not R_LIBS
# edd Jan 2023 Modify R_LIBS_{USER,SITE} respecting existing values (cf discussion with Kurt Hornik)
R_LIBS_USER=${R_LIBS_USER:-'%U'}
R_LIBS_SITE=${R_LIBS_SITE:-'/usr/local/lib/R/site-library:%S'}and there also is this in Renviron.site
## # We comment out this line in the default Renviron, you can re-enable it here
## # @R_PLATFORM@ can be eg x86_64-pc-linux-gnu, see /etc/R/Renviron for R_PLATFORM
## # @MAJ_MIN_VERSION@ is likely something like '3.4', see /etc/R/Renviron too
## #
## # Also note that you set this per-user via '%p' and '%v' for platform and version
#R_LIBS_USER=${R_LIBS_USER-'~/R/@R_PLATFORM@-library/@MAJ_MIN_VERSION@'}as well as this possible interacting with what I have above:
## edd Apr 2003 Allow local install in /usr/local, also add a directory for
## Debian packaged CRAN packages, and finally the default dir
## edd Jul 2007 Now use R_LIBS_SITE, not R_LIBS
## edd Mar 2022 Now in Renviron.site reflecting R_LIBS_SITE
R_LIBS_SITE="/usr/local/lib/R/site-library/:${R_LIBS_SITE}:/usr/lib/R/library"
There was a problem hiding this comment.
I am not sure where does that leave us with regards to this PR: Do we agree or disagree to remove the R_LIBS definition as proposed by this PR ?
There was a problem hiding this comment.
Based on my testing using R 4.4.2, changing this line from using R_LIBS to R_LIBS_SITE will also resolve the issue of the user's library path being set last:
echo "R_LIBS_SITE=\${R_LIBS_SITE:-'${R_HOME}/site-library:${R_HOME}/library'}" >> "${R_HOME}/etc/Renviron.site"
After that change, the user's library path will always be set first.
As per discussion in #857 this is a PR to fix the issue.