Use R in Jupyter Lab on macOS

Here I am assuming that you have a Python virtual environment in which you set up Jupyter Lab in macOS 10.15.

  1. Activate your virtualenv.
  2. Start R in your terminal. You can check where R is located by running system("type R").
  3. Install necessary packages by running install.packages('IRkernel') in R.
  4. To make the R kernel available to Jupyter, run IRkernel::installspec() in R.
  5. Reload your Jupyter Lab page if you have already been using Jupyter Lab.

Now you can create a new notebook with R kernel.

Comments

Copied title and URL