RStudio: An IDE for R
Description
RStudio is a free and open-source integrated development environment for R
Installed Versions
To know which versions of RStudio are installed in the HPC cluster use
module spider rstudio
Output:
-----------------------------------------------------------------------------------------
rstudio:
-----------------------------------------------------------------------------------------
Description:
IDE for R
Versions:
rstudio/1.0.136
rstudio/1.0.153
-----------------------------------------------------------------------------------------
For detailed information about a specific "rstudio" module (including how to load the modules) use the module's full name.
For example:
$ module spider rstudio/1.0.153
-----------------------------------------------------------------------------------------
Note: we only had two versions when we wrote this guide. Please run the commands to discover newer versions.
Loading the Module
In this example, we will try to load rstudio/1.0.153
First, we need to make sure we are in the correct hierarchy. To know what modules need to be loaded in order to use RStudio, use
module spider rstudio/1.0.153
Output:
----------------------------------------------------------------------------------------
rstudio: rstudio/1.0.153
---------------------------------------------------------------------------------------
Description:
IDE for R
You will need to load all module(s) on any one of the lines below before the "rstudio/1.0.153" module is available to load.
gcc/6.3.0 openmpi/2.0.1
This tells us that we need to be in the gcc/6.3.0 + openmpi/2.0.1.
Just logging into the cluster use
module swap intel gcc
module load rstudio
One can also check the modules that have been loaded with
module list
Output:
Currently Loaded Modules:
1) StdEnv 3) openmpi/2.0.1 5) R/3.3.3 7) base/8.0 9) rstudio/1.0.153
2) gcc/6.3.0 4) texlive/2016 6) libbsd/0.8.6 8) gstreamer/0.10.36
We can observe that the module for RStudio already loads the required dependencies, including R/3.3.3.
Using RStudio
Since RStudio requires GUI, we recommend using one of the software in our visual access (for example, X2Go or OnDemand desktop application) to obtain the best performance.
From X2Go, open a terminal on the head node with GUI, then request an interactive session on a compute node. [The OnDemand desktop will launch on a compute node, and is therefore already an interactive session. Consider resource allocation to support rstudio when launching the Desktop application from OnDemand.]
srun --x11 --pty /bin/bash
NOTE: Above is a very simple use of 'srun' to obtain an interactive session, and will only provide default, minimal resources. If you plan to use RStudio to run R scripts, you might want to allocate more memory and more CPUs than what is given by the default command above. We refer to the Interactive Job Session documentation if you need extra resources.
Then we load the RStudio module
module swap intel gcc
module load rstudio
And we can execute RStudio with the command
rstudio
You should obtain a window like the one in the picture.
Troubleshooting
Copy-Paste
If copy-paste in the editor produces a single dot on a compute node (either with CTRL+C - CTRL-V or with right-clicking and selecting "copy" and then "paste"), and you are using the KDE environment, then the Klipper is interfering with the clipboard on the compute node. The solution is to close Klipper as shown in the following picture: