Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

R upgrade to 3.4 installing packages

Tags:

r

I had R working perfectly until I decided to upgrade to 3.4. Now I am unable to install packages.

while installing packages I get an error

Installing package into ‘/usr/local/lib/R/site-library’
(as ‘lib’ is unspecified)
Warning in install.packages("ggplot2") :
  'lib = "/usr/local/lib/R/site-library"' is not writable
Would you like to use a personal library instead?  (y/n) 

If I hit yes I get

Would you like to create a personal library
NA
to install packages into?  (y/n) 

at which point it proceeds give this error

Error in install.packages("quantstrat") : unable to create ‘NA’
like image 562
kbk78 Avatar asked Jan 22 '26 03:01

kbk78


1 Answers

I don't know why R 3.4.1 changes the library path. To change it back, simply edit /etc/R/Renviron:

$ sudo gedit /etc/R/Renviron

Comment-out R_LIBS_SITE=... then uncomment R_LIBS_USER=...

# edd Jun 2017  Comment-out R_LIBS_USER
R_LIBS_USER=${R_LIBS_USER-'~/R/x86_64-pc-linux-gnu-library/3.4'}

# 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
#R_LIBS_SITE=${R_LIBS_SITE-'/usr/local/lib/R/site-library:/usr/lib/R/site-library:/usr/lib/R/library'}  
like image 56
Tung Avatar answered Jan 23 '26 21:01

Tung