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?
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.
> install.packages("car", lib="/my R packages/")
Warning in install.packages :
'lib = "/my R packages/"' is not writable
My solution to the problem was to load the package within R Studio using the 'Packages' window which then does the following:
> install.packages("car")
Installing package into ‘C:/Users/33386/Documents/R/win-library/3.1’
(as ‘lib’ is unspecified)
trying URL 'http://cran.rstudio.com/bin/windows/contrib/3.1/car_2.0-21.zip'
Content type 'application/zip' length 1332800 bytes (1.3 Mb)
opened URL
downloaded 1.3 Mb
package ‘car’ successfully unpacked and MD5 sums checked
The downloaded binary packages are in
C:\Users\33386\AppData\Local\Temp\RtmpKWnZD4\downloaded_packages
>
Briefly:
Use chmod
to change the directory mode: chmod u+w /data/R/packages
. You may need sudo
(or your admin) to do that.
Use an editor and create and save a file: editor ~/.Renviron
. You could also copy Renviron.site
from R's etc/
directory and start from that.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With