[R-sig-Debian] Where/how to set R_LIBS_SITE in R 4.2.0 for running R as R --vanilla to pick up "/usr/local/lib/R/site-library/"

Sam H @@m@hhh1 @end|ng |rom gm@||@com
Mon Apr 25 22:06:43 CEST 2022


Dirk, thank you.

I do have the following lines in /usr/lib/R/etc/Renviron.site (see below):
  ## 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'"

Unfortunately, somehow it doesn't work for me and I don't have a clue why:
username using usernameVB:~$ lsb_release -a
No LSB modules are available.
Distributor ID: Ubuntu
Description: Ubuntu 20.04.4 LTS
Release: 20.04
Codename: focal
username using usernameVB:~$ Rscript --version
Rscript (R) version 4.2.0 (2022-04-22)
username using usernameVB:~$ Rscript -e '.libPaths()'
[1] "/usr/local/lib/R/site-library" "/usr/lib/R/site-library"
[3] "/usr/lib/R/library"
username using usernameVB:~$ Rscript --vanilla -e '.libPaths()'
[1] "/usr/lib/R/site-library" "/usr/lib/R/library"
username using usernameVB:~$ cat /usr/lib/R/etc/Renviron.site
## Emacs please make this -*- R -*-
## empty Renviron.site for R on Debian
##
## Copyright (C) 2008 - 2022  Dirk Eddelbuettel and GPL'ed
##
## see help(Startup) for documentation on ~/.Renviron and Renviron.site

# ## Example ~/.Renviron on Unix
# R_LIBS=~/R/library
# PAGER=/usr/local/bin/less

# ## Example .Renviron on Windows
# R_LIBS=C:/R/library
# MY_TCLTK="c:/Program Files/Tcl/bin"

# ## Example of setting R_DEFAULT_PACKAGES (from R CMD check)
# R_DEFAULT_PACKAGES='utils,grDevices,graphics,stats'
# # this loads the packages in the order given, so they appear on
# # the search path in reverse order.

## # 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 using -library/@MAJ_MIN_VERSION@'}

## edd May 2019
##
## Debian (and its derivatives) impose a set of compiler flags to prevent
some known
## security issues with compiled code.  These flags then become defaults
for R as well
## (see eg /etc/R/Makeconf) but nevertheless confuse R as warnings get
triggers.  Users,
## on the other hand, are often stumped about these.  So with this variable
we declare
## these options as known for the local checks on the machine this file is
on.
##
## See Section 8 of the R Internals manual for many more options to
customize tests.
_R_CHECK_COMPILATION_FLAGS_KNOWN_='-Wformat -Werror=format-security
-Wdate-time'

## 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"
username using usernameVB:~$

Best,
Sam

On Mon, Apr 25, 2022 at 9:44 PM Dirk Eddelbuettel <edd using debian.org> wrote:

>
> On 25 April 2022 at 21:12, Sam H wrote:
> | I have upgraded to R 4.2.0 on Ubuntu Ubuntu 20.04.4 LTS.
> |
> | Something changed since now when invoking R as "R --vanilla" does not
> pick
> | up "/usr/local/lib/R/site-library" library anymore.
>
> I noticed that too when beta testing the earlier builds. It has to do with
> us
> (previously) setting value to unset variables ... which are now set.
>
> For the Debian package I managed the change by moving the setting to
> Renviron.site:
>
>   ## 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'"
>
> If you have those three lines you should be fine. I am (also on Uubuntu
> 20.04
> which a binary from my PPA):
>
>   # lsb_release -a
>   No LSB modules are available.
>   Distributor ID: Ubuntu
>   Description:    Ubuntu 20.04.4 LTS
>   Release:        20.04
>   Codename:       focal
>   # Rscript --version
>   Rscript (R) version 4.2.0 (2022-04-22)
>   # Rscript -e '.libPaths()'
>   [1] "/usr/local/lib/R/site-library" "/usr/lib/R/site-library"
>   [3] "/usr/lib/R/library"
>   #
>
> Dirk
>
> --
> dirk.eddelbuettel.com | @eddelbuettel | edd using debian.org
>


-- 
Best regards,
Sam

	[[alternative HTML version deleted]]



More information about the R-SIG-Debian mailing list