After installing R and RStudio in Ubuntu 16.04 with the following code:
sudo apt-get update
sudo apt-get install r-base
sudo apt-get install r-base-dev
and
sudo apt-get install gdebi-core
wget https://download1.rstudio.org/rstudio-1.0.143-amd64.deb
sudo gdebi rstudio-1.0.143-amd64.deb
I am trying to install packages and I am getting errors in R console like
install.packages("fGarch") 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
As I am new in Linux I do not know in which directory install the R packages.
I am not sure whether this is the problem or if I did any mistake on the installation. Can anyone help me with this issue? Thanks in advance.
Best Answer
I don't know why R 3.4.1 changes the library path. To change it back, simply edit
/etc/R/Renviron
:Comment-out
R_LIBS_SITE=...
then uncommentR_LIBS_USER=...