Creating a Mamba environment for specific R versions

Tempest is now configured to run RStudio-Server on compute nodes.

RStudio-Server will accept any version of R you have installed. RCI recommends using Mamba (aka. Anaconda) environments as they are easily managed and R packages (extensions) are easily installed with all the proper dependencies.

 To install R versions beyond the default 4.2.1, log into Tempest through the Terminal:

ssh <NetID>@tempest-login.msu.montana.edu 

 To create a mamba environment with a new version of R:

module load Mamba
mamba init # ONLY run this if you haven't initialized the shell
mamba create -n <name> r-base='VERSION' #<name> is the name of the environment

To get a list of available R versions (only a subset of output shown below):

mamba search r-base  # r-base is the base R package

mamba search rbase

*Note: RCI recommends you use the Anaconda channel “conda-forge”, it is the most widely supported. This will be the default in the below commands.

Create a new mamba environment for your specific R version:

mamba create -n <name_of_environment> r-base='<name_of_R_version> 

# For example:
mamba create -n r3.5.1 r-base='3.5.1'

Verify successful creation of the Mamba environment: 

mamba env list
# conda environments:
#
r3.5.1                   /home/<your_net_id>/.conda/envs/r3.5.1

The first column shows you the names of your mamba environment. The second shows you the location of your mamba environment

Running RStudio-Server with specific R version

  • To access a web-based RStudio environment running on Tempest, follow the instructions below:

Tempest web login

  • Open the RStudio initialization page
    1. Select the "Interactive Apps" Dropdown menu from the the top bar
    2. Select from the dropdown "RStudio on Tempest"

Select RStudio on Tempest

  • Select the resources and account to run your RStudio session
    1. Select RStudio-Mamba on Tempest from the left sidebar
    2. Select the account and partition
      • Note: Your partition must match your account.
        • E.g. if using priority-<account_name> account, you must specificy the "priority" partition.
        • If using group-<account_name> account, you must specify the "unsafe" partition
    3. Select the compute resources you will need for your session
      • Note: Fewer resources will fit into the queue faster and your session will be more likely to start immediately. Use the bare minimum resources necessary.
        • E.g. For a simple rscript to process a dataframe < 1 GB in size, 8 CPUs and 2 GB of memory is plenty
    4. Select the number of hours you will need for your session
      • Note: you can save scripts and re-open them in different sessions, but session data will not be saved. Be sure to save all final results as output files.
    5. Launch your RStudio session

RStudio Mamba on Tempest

  • Connect to your RStudio Server session
    • Once resources are available on the cluster for your session, it will automatically start. To enter the session click "Connect to Rstudio Server"

Connect to custom R RStudio session

  • Open a new Rscript and begin using RStudio
    • Note: Any packages installed will be specific for this R version and will be available in future sessions
# To install a package: 
install.packages("<package-name>")

# In a future session, you can use:
library(<package-name>) 

open new Rscript