Both R and Rstudio are preinstalled on all clusters. “module avail R” and “module avail rstudio” will list the available base versions.
Running Rstudio
Rstudio Desktop is launched from the Sabalcore Remote Graphics. By default, the latest version of R is used. To use a different version of R with Rstudio, see “Launching Rstudio from Command Line’ below.
- Start or open a remote graphics session. Select ‘Plugins –> Remote Graphics’. More detail here.
- From the Sabalcore icon at the bottom, select Rstudio.
- Choose a compute node and number of cores you want to use.
- Click start. In a few moments Rstudio Desktop will show.
- Be sure to completely exit the job when finished or you will continue to incur charges.
Installing Rstudio packages
Install packages as you normally would by using the rstudio console or Tools –> Install packages. Packages will be installed in your account so you only need to do this once.
Launching Rstudio from Command Line
To launch Rstudio from the command line, first start an interactive job.
- Start or open a remote graphics session. Select ‘Plugins –> Remote Graphics’. More detail here.
- From the Sabalcore icon at the bottom, select Interactive Job
- Designate which cluster node you would like to use and number of cores. For example to use 1 red node with 16 cores, enter “1:red:ppn=16”.
- Click Start
- After the job starts, a terminal will display. From this terminal, load R and Rstudio modules. For example, enter “module load R/3.6.1” or “module load R/4.0.2”. And load the Rstudio module, “module load rstudio”
- Finally, enter “rstudio” to launch Rstudio Desktop.
- Be sure to completely exit the job when finished or you will continue to incur charges.
Fixing the cursor in the Rstudio console
Rstudio (on linux) has bug where the cursor is not aligned with the text. To fix this, from Rstudio, go to “Tools –> Global Options –> Appearance –> Editor Font” and select “Fira Code” font. This setting will be saved so you don’t have to set each time you run Rstudio.