I tried this code to install R package to a directory where I stored my R packages.
install.packages("zoo", lib="/data/Rpackages/")
I got this warning message:
Warning in install.packages("zoo", lib = "/data/Rpackages/") : 'lib = "/data/Rpackages/"' is not writable
Secondly how do I create a file .Renviron
in our home area and add the line R_LIBS=/data/Rpackages/
to it?
Try running R studio as administrator. If you are using ubuntu start R using sudo R
How do you actually get out of the warning situation? Is there a better way other than (in R Studio menus) Session->Interrupt R and terminating the R session? I tried CTRL-C.
My solution to the problem was to load the package within R Studio using the 'Packages' window which then does the following:
Briefly:
Use
chmod
to change the directory mode:chmod u+w /data/R/packages
. You may needsudo
(or your admin) to do that.Use an editor and create and save a file:
editor ~/.Renviron
. You could also copyRenviron.site
from R'setc/
directory and start from that.