Charles Thuo
2013-Sep-16 07:01 UTC
[R] is it possible to install R packages without admin rights on a work station
How can a person in a controlled environment install additional R packages.. Charles. [[alternative HTML version deleted]]
Rolf Turner
2013-Sep-16 08:46 UTC
[R] is it possible to install R packages without admin rights on a work station
On 09/16/13 19:01, Charles Thuo wrote:> How can a person in a controlled environment install additional R > packages...Use a "local library" in your user space. Create a directory --- I called mine "Rlib", and it is located in my home directory. I.e. my local library is /home/rolf/Rlib. Then when using install.packages() from within R I invoke the function with the syntax install.packages("<whatever>",lib="/home/rolf/Rlib",<other possible arguments>) Installing from source, from the command line I do: R CMD INSTALL <whatever>.tar.gz -l /home/rolf/Rlib To load a package from one's local library one can do things like: library(<whatever>,lib.loc="/home/rolf/Rlib") Note that the argument specifying the local library is named "lib" in install.packages() but is named "lib.loc" in library(). I can never remember which is which. Psigh! Or you can add your local library to your .libPaths(), as in: .libPaths("/home/rolf/Rlib") You can put a line like this in your .Rprofile file so that it gets done automatically when you start R. Or you can set an environment variable R_LIBS: setenv R_LIBS /home/rolf/Rlib (if using csh) or R_LIBS = /home/rolf/Rlib export R_LIBS (if using bash). HTH cheers, Rolf Turner
Daniel Hornung
2013-Sep-16 08:55 UTC
[R] is it possible to install R packages without admin rights on a work station
On Monday, September 16, 2013 09:01:03 Charles Thuo wrote:> How can a person in a controlled environment install additional R > packages.. > > Charles.Hello Charles, a slight variation of what Rolf wrote, this is my setup: in my ~/.Rprofile (which is read at R's startup), I set the R_LIBS_USER variable like so: R_LIBS_USER=~/.local/share/R/libs Of course you may vary the exact path according to your liking. Another helpful option I found is the follwoing, if you decide you like a specific repository best (to avoid the selection dialog): in your ~/.Rprofile, add this line: options(repos=structure(c(CRAN="http://ftp5.gwdg.de/pub/misc/cran/"))) (Use the repo which is fastest for you). HTH, Daniel -- Max-Planck-Institute for Dynamics and Self-Organization Laboratory for Fluid Dynamics, Pattern Formation and Biocomplexity Biomedical Physics Group Am Fassberg 17 D-37077 Goettingen (+49) 551 5176 373 -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 836 bytes Desc: This is a digitally signed message part. URL: <https://stat.ethz.ch/pipermail/r-help/attachments/20130916/41dc092e/attachment.bin>