From 50ab3b4a9d75b91983a06ef47785d791c63b2e56 Mon Sep 17 00:00:00 2001 From: evezeyl <45561997+evezeyl@users.noreply.github.com> Date: Fri, 12 Apr 2019 11:04:31 +0200 Subject: [PATCH] added little conda-R trick To be able to use R from different conda environments with one R studio --- techstuff.md | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) diff --git a/techstuff.md b/techstuff.md index a13fc47..fd60f01 100644 --- a/techstuff.md +++ b/techstuff.md @@ -12,6 +12,9 @@ * [Changing your login shell](#Changing-your-login-shell) * [Sharing data via a shared folder](#Sharing-data-via-a-shared-folder) +### Working with different R in several conda environment with one Rstudio +* [One Rstudio for several conda R environments on your PC](#One-Rstudio-for-all-condas) + ## [Using screen](#using-screen) to avoid dropped connections @@ -134,6 +137,28 @@ This should give you a prompt that starts with the following: ```(ncbidown) ``` Now you are all set to use the different conda environments available on the nn9305k project. +## One Rstudio for several conda R environments on your PC +To avoid multiple installations of Rstudio in several environments, it is possible to define which R (in which conda environment) will be used for interpretation in R studio: + +[Rstudio Article](https://support.rstudio.com/hc/en-us/articles/200486138-Changing-R-versions-for-RStudio-desktop) + +For ubuntu + +``` +cd ~ +nano .bashrc +# add the following line to .bashrc +export RSTUDIO_WHICH_R="which R" +# save and close .bashrc +# close and restart console or: +source .bashrc +``` +You can now activate the conda environment (with the R version and packages you want to work with) `conda activate `or `source activate