Sam H
2022-Apr-25 20:29 UTC
[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/"
Dirk, thanks. I will try to debug locally. Thanks for the instructions. Just to make sure it is only me: when you run the following commands ($ Rscript -e '.libPaths()') without and with --vanilla on your system you get the same output (as you see below I don't): username at usernameVB:~$ Rscript -e '.libPaths()' [1] "/usr/local/lib/R/site-library" "/usr/lib/R/site-library" [3] "/usr/lib/R/library" username at usernameVB:~$ Rscript --vanilla -e '.libPaths()' [1] "/usr/lib/R/site-library" "/usr/lib/R/library" Thanks. Best regards, Sam On Mon, Apr 25, 2022 at 10:21 PM Dirk Eddelbuettel <edd at debian.org> wrote:> > Sam, > > Please try to debug locally. There are command-line switches to R that > allow > you to turn sourcing of initializations files off, you can also try to see > if > it is different for 'root' as opposed to you account. > > When I chase something like that his I typically > > a) add lines like message("running from file foo") in Rprofile, > Rprofile.site, ~/.Rprofile etc > b) set env vars in each Renviron / Renviron.site / ~/.Renviron file to > see > which are being hit. > > Something somewhere turns some values off for you. I can't tell from here > what caused it. > > Dirk > > -- > dirk.eddelbuettel.com | @eddelbuettel | edd at debian.org >-- Best regards, Sam [[alternative HTML version deleted]]
Dirk Eddelbuettel
2022-Apr-25 20:50 UTC
[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/"
On 25 April 2022 at 22:29, Sam H wrote: | Just to make sure it is only me: when you run the following commands ($ | Rscript -e '.libPaths()') without and with --vanilla on your system you get | the same output (as you see below I don't): | username at usernameVB:~$ Rscript -e '.libPaths()' | [1] "/usr/local/lib/R/site-library" "/usr/lib/R/site-library" | [3] "/usr/lib/R/library" | username at usernameVB:~$ Rscript --vanilla -e '.libPaths()' | [1] "/usr/lib/R/site-library" "/usr/lib/R/library" I see the same on Ubuntu with R 4.2.0. This is likely due to me having to move the setting for /usr/local/lib/R/site-library from R's own Renviron to Renviron.site and --vanilla skip reading that. Dirk -- dirk.eddelbuettel.com | @eddelbuettel | edd at debian.org
Dirk Eddelbuettel
2022-Apr-25 21:00 UTC
[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/"
So in short: If you want to run R with --vanilla you have to change the local set up file. Because R now ships with this R_LIBS_USER=${R_LIBS_USER:-'%U'} R_LIBS_SITE=${R_LIBS_SITE:-'%S'} you could set R_LIBS_USER and/or R_LIBS_SITE in a file read by the OS before R starts -- a short text snippet in /etc/profile.d/ may work -- to ensure R_LIBS_USER and R_LIBS_SITE are set to your liking. Sorry for missing the hint about --vanilla from your first email. Dirk -- dirk.eddelbuettel.com | @eddelbuettel | edd at debian.org