macOS下Jupyter Notebook的安装以及对R语言的支持
1. 部署Jupyter Notebook
1.1 安装pip
sudo easy_install pip
1.2 安装jupyter
pip3 install jupyter
1.3 启用Jupyter Notebook
jupyter notebook
2. 添加R语言支持
2.1 IRkernel
Jupyter Notebook是前身为Ipython的一种在线编译器,因此要让Jupyter Notebook能够支持R语言,需要安装一个较为关键的包:IRkernel
IRkernel需要在Jupyter Notebook的Terminal中启动R语言来进行安装
R
2.2 安装IRkernel
>install.packages(c('repr', 'IRdisplay', 'evaluate', 'crayon', 'pbdZMQ', 'devtools', 'uuid', 'digest'))
>devtools::install_github('IRkernel/IRkernel')
2.3 运行IRkernel
>IRkernel::installspec()
2.4 测试
运行完成后退出R,在Terminal中进入jupyter notebook,右上角的New中有出现R选项,则说明安装成功!