diff --git a/rstudio1.md b/rstudio1.md index be2f90f91a2210c412899e0cb4d421e911f6c5b3..4d44aa4d30cfc3deec5941d9ab124acfa00f3d76 100644 --- a/rstudio1.md +++ b/rstudio1.md @@ -201,6 +201,33 @@ that we can install the package via the system. - https://github.com/eddelbuettel/rcppapt (not yet implemented) +### ignore system packages + +If you do not want to use the system packages for some reason you need to +change the path where R is looking for packages. This must be done at session +startup and is done by defining environment variables. For rstudio to use the +environment variables specify them in a file called `.Renviron`. This file can +either be placed in your home directory or in your working directory. If it is +in a working directory and rstudio did not start with that working directory, +change to it and restart R. + +Example: + +1. Check your current pathes with `.libPaths()` +1. create directory `~/testsession` +1. create file `.Renviron` in that directory with the content + ``` + R_LIBS_SITE=/usr/local/lib/R/site-library/ + ``` +1. login to https://rstudio.idiv.de +1. `Session -> Set Working Directory -> Choose Directory` and select the + `~/testsession` directory +1. `Session -> Restart R` +1. Ensure `.libPaths()` contains only the pathes you expect +1. Now install the packages you require. + +[R Startup Documentation](https://stat.ethz.ch/R-manual/R-devel/library/base/html/Startup.html) + ## Other servers with R