2017-07-02 86 views
2

我已經完美的R工作,直到我決定升級到3.4。現在我無法安裝軟件包。R升級到3.4安裝包

在安裝包我得到一個錯誤

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) 

如果我打是的,我得到

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

此時它繼續給這個錯誤

Error in install.packages("quantstrat") : unable to create ‘NA’ 
+3

設置'.libPaths()'到你有寫權限的目錄。 – alistaire

+0

您可以在/ etc/R/Renviron中取消註釋R_LIBS_USER或(設置新路徑) – user20650

+0

這有效。謝謝! – kbk78

回答

0

我不知道爲什麼R 3.4.1更改庫路徑。要把它改回來,只需編輯/etc/R/Renviron

$ sudo gedit /etc/R/Renviron 

註釋掉R_LIBS_SITE=...然後取消註釋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'}