Skip to content

The R kernel for Jupyter

Installing the R kernel for Jupyter Notebook and JupyterLab

In order to use the R kernel for Jupyter Notebook (or Lab), you will first need to log into the cluster, load the R and Anaconda modules with the same versions you intend to use within the Jupyter app, launch R, and install the IRkernal package as follows:

$ module load python3.12-anaconda/2024.06-1
$ module load R/4.5.1
$ R

> install.packages('IRkernel', repo='https://mirror.its.umich.edu/cran/')

If this is your first time installing an R package on the cluster (or the first time for a particular version of R), you will need to respond "yes" to use a personal library, and "yes" again to create a personal library to install packages into.

Next, install the kernel spec, as follows:

> IRkernel::installspec()

After quitting R, log into Open OnDemand (OOD), see Open OnDemand, and select JupyterLab/Jupyter Notebook from the Interactive Apps menu.

Jupyter Module command example

Load the R module for JupyterLab/Notebook

When completing the form to initiate a new Jupyter session in Open OnDemand, you must use the Module commands field (found near the bottom of the OOD form) to load the same R module, including version number, that you used when you installed the R kernel. See the image to the right to see the Module commands field properly entered. You do not need to include anything in the field for sourcing a setup file. When the Jupyter app launches, you will now have the option to open R in a notebook.

If have questions about using other kernels with JupyterLab or Jupyter Notebook, please contact VACC support at vacchelp@uvm.edu.