Python用Jupyter写分析记录比较舒服,学了R也想在Jupyter上运行。
-
安装R语言、Jupyter程序
-
在R Console中安装1
-
install.packages(c('repr', 'IRdisplay', 'evaluate', 'crayon', 'pbdZMQ', 'devtools', 'uuid', 'digest'))
安装需要的基础包 -
devtools::install_github('IRkernel/IRkernel')
安装IRkernel包 -
IRkernel::installspec(user = FALSE)
通过intallspec()函数,使Jupyter能够找到刚刚安装的R核
通过设置user=FALSE安装在系统中
-
不熟悉的可能会出现一些错误,可以采用下面简单的办法
直接在Anaconda prompt中运行2,参考官网做法:https://docs.anaconda.com/anaconda/navigator/tutorials/r-lang/:
conda install -c r r-essentials
-
如何在Jupyter Notebook里添加R核的详细步骤 ↩︎
-
Jupyter安装r内核 ↩︎