Cursor for R series (Part 2)
Running R in Jupyter Notebooks with Cursor

The second part of the Cursor for R series. Learn how to set up Jupyter Notebooks for R inside Cursor.

Author

Affiliation

Franziska Ahrend

Published

June 05, 2025

This is Part 2 of my mini-series on making R work smoothly inside Cursor since I could not find a single tutorial online. In Part 1, I showed you how to install Cursor and set up R. Now, we'll take it further and run R in Jupyter Notebooks - fully inside Cursor.

Installing Jupyter Notebook

To run Jupyter Notebooks (for R or any other language), you first need to install the jupyter command line tool (More info and alternative installation options). Open your terminal and run:

Shell
pip3 install jupyter

# or pip install jupyter

You can test if it installed correctly by running jupyter notebook in your terminal. This should give you a link to paste into your browser. If that works: great! You're ready to go.

Install R kernel

Now we connect R to Jupyter using the IRkernel.

A kernel is what runs your code inside a notebook. Jupyter supports different kernels for different languages. For R, we use IRkernel. (Later I also show how to set up a bash kernel).

Inside R (either by typing R in your terminal or in your installed Cursor .R file), run:

R
install.packages("IRkernel")
IRkernel::installspec()

For more information about IRkernel, check out the IRkernel documentation.

Selecting installed kernels in Cursor

Once IRkernel is installed, you can create a new .ipynb file in Cursor.

When you open it, Cursor should prompt you to install the Jupyter Notebook extension (if it hasn't already).

To switch to the R kernel: Click Select Kernel (top right) → Jupyter Kernel → Choose R.

Cursor IDE showing kernel selection menu with R option visible
Selecting the R kernel in Cursor

If you don't see the R kernel right away, restart Cursor and try searching for R in the kernel selection menu.

You can also check your installed kernels with:

Shell
jupyter kernelspec list

If ir appears (see Terminal section of image below), your R kernel is ready!

Helpful addition: Install bash kernel

Sometimes it's useful to run shell commands directly in a Jupyter Notebook (e.g. for preprocessing or documenting data). You can install a Bash kernel like this:

Shell
pip install bash_kernel

python -m bash_kernel.install

After installing, click Select Kernel (or where the current kernel is selected as in the image below), and you should see "Bash" as an option (or you can search for it in the Jupyter Kernel...-section) as shown below:

Cursor IDE showing kernel selection menu with Bash option visible
Selecting the Bash kernel in Cursor

Troubleshooting

Here's a checklist if something isn't working:

For additional help with Jupyter Notebooks, refer to the official Jupyter Notebook documentation.

Subscribe to stay up to date on Bioinformatics news and trends.

* indicates required

Related Articles