From 79973c1147c438a089ce7b4024cdfa0106a425fb Mon Sep 17 00:00:00 2001 From: Dirk Sarpe <dsarpe@posteo.de> Date: Tue, 20 Oct 2020 13:47:04 +0200 Subject: [PATCH] document how to ignore system packages with rstudio --- rstudio1.md | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) diff --git a/rstudio1.md b/rstudio1.md index be2f90f..4d44aa4 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 -- GitLab