Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

ERROR:root:Cell magic `%%R` not found

Tags:

r

jupyter

rpy2

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.
like image 958
Hello lad Avatar asked Apr 28 '17 14:04

Hello lad


2 Answers

In a terminal:

pip install rpy2

In a notebook:

%load_ext rpy2.ipython

Then you can use %%R:

%%R
var <- c(1, 2, 3)
like image 106
davipatti Avatar answered Nov 01 '22 01:11

davipatti


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.

like image 23
Whitequill Riclo Avatar answered Nov 01 '22 02:11

Whitequill Riclo