[R] /usr/local/lib/R/site-library is not writable

Gene Leynes g|eyne@ @end|ng |rom gm@||@com
Wed Apr 7 21:40:04 CEST 2021


Hello R Community,

I've been using R for a long time, and this is a question that still makes
me think twice every single time I install R, which is more and more often .

The first search hit is this StackOverflow question:
https://stackoverflow.com/questions/32540919/library-is-not-writable

The warning message hasn't changed over the years:

install.packages("randomForest")
Installing package into ‘/usr/local/lib/R/site-library’
(as ‘lib’ is unspecified)
Warning in install.packages :
  'lib = "/usr/local/lib/R/site-library"' is not writable

In this question they suggest using the personal library, which is what I
end up doing as well, but some people suggest changing your group.  This
actually seems like the right answer to me, but others say they had
problems when they changed groups, which also sounds about right.

Can someone please tell me (or tell StackOverflow) the real best practice?

I've gotten into some very thorny issues with installations that can't find
any library when I deploy jobs using cron or other users, and it's hard to
remember / figure out how to install (if missing) libraries in the script
because it's hard to remember the mirror syntax.

I know there's a packrat  package, and I've invented some workarounds, but
I normally just need two or three stable packages for a particular project.
I'd bet that .libPaths would be implemented differently today, but maybe
with the right library path none of that would be necessary to understand?

My final simplified questions are:

   1. What is the best practice to install libraries so that the current
   user (Linux) can always find them?
   2. Why is the default library path not writable by default, should we
   change that?

Hope everyone's doing well out there, and I hope to see some of you at
conferences when things get back to normal.

Thank you,

Gene

	[[alternative HTML version deleted]]



More information about the R-help mailing list