I am using the Jupyter notebook to create interactive code sheets in Python. Now that I have to work with R, I'm wondering: Can I use Jupyter notebook to compile R code as well?


Yes, even though Jupyter was originally designed for python, it supports R among a whole bunch of other programming languages.

In order for a programming language to be compiled correctly in the notebook, the corresponding kernel has to be installed. You'll find the R-Kernel under the name "IRkernel" with installation instructions on github.

Once you installed the kernel, you should be able to select it from a dropdown menu in the notebook. If you want to start an interface with R kernel, use the --kernel= parameter:

# “ir” is the kernel name installed by the above `IRkernel::installspec()`
# change if you used a different name!
jupyter qtconsole --kernel=ir
jupyter console --kernel=ir

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.