Problem
When using R Cell Magic, %%R
in Jupyter Notebook on Windows, the text based output is directed to the console, Anaconda Prompt rather than the Jupyter Notebook.
%%R a <- c(1, 2, 3, 4, 5);
summary(a)
Solution
To resolve this issue, use capture.output()
function with Line Magic, %%R
to direct output to the Jupyter Notebook.
%%R a <- c(1, 2, 3, 4, 5);
b <- capture.output(summary(a))
%R b
The output will be directed to the Notebook.
TIP: See this example.