10

I have python 3 env

installed rpy2 with

conda install -c r rpy2=2.8.5

load the cell magic in jupyter notebook with

%load_ext rmagic

when I try to use R block in notebook, it gives me the error

ERROR:root:Cell magic `%%R` not found.
Hello lad
  • 17,344
  • 46
  • 127
  • 200

2 Answers2

13

In a terminal:

pip install rpy2

In a notebook:

%load_ext rpy2.ipython

Then you can use %%R:

%%R
var <- c(1, 2, 3)
davipatti
  • 316
  • 2
  • 6
1

This is a link to the best answer I have found to the problem given on this thread: R Notebook.

This link states that the error means that R is not configured in your DSS instance. You need to install R manually.

The commands given on the forum post are:

  1. Install the R packages RJSONIO and HTTR in any R console.
  2. Install the Python package rpy2:

    pip install rpy2

Afterward, they give the following link: configure R.

I hope this is helpful and well worded.

Whitequill Riclo
  • 788
  • 2
  • 8
  • 19