stevec
stevec

Reputation: 52777

Install and run R kernel for Jupyter Notebook?

I have jupyter notebook installed, I also have R installed. Both work fine independently.

When I run jupyter with jupyter notebook, then try to open an ipynb file, I see

enter image description here

The only option in the dropdown is Python 3 (R is not an option).

Question

How do you open a jupyter notebook with an R kernel (on mac)?

Note

Upvotes: 9

Views: 31258

Answers (2)

stevec
stevec

Reputation: 52777

Open any R session (e.g. in RStudio is fine, or open terminal/bash and type R to start an R session).

Install the kernel with:

install.packages("devtools")
devtools::install_github("IRkernel/IRkernel")
IRkernel::installspec()

Close and reopen the notebook and the R kernel will now be available.

Upvotes: 17

Antoni Parellada
Antoni Parellada

Reputation: 4811

If the R kernel does not appear as an option within a Jupyter notebook even after installing R, and one is using Anaconda, bringing up the conda prompt from the Start menu (Windows 10), and running the following commands may do the trick:

conda config --add channels r
conda install --yes r-irkernel

Credit to this post.

Upvotes: 2

Related Questions