Jupyter Lab 安装 R Kernel
Jupyter lab 默认支持 Python Kernel,但不支持 R Kernel,因 Prophet 有 R 版本,特安装体验之。
小编的环境:macOS Catalina
前置条件
- 已完成 Jupyter Lab 安装)
1. 安装 R Language
从 R 官网open in new window 下载安装包,安装之。
2. 安装 R Kernel for Jupyter
打开 R Console ,安装 R kernel
> install.packages("devtools")
trying URL 'https://mirrors.e-ducation.cn/CRAN/bin/macosx/contrib/4.0/devtools_2.4.0.tgz'
Content type 'application/x-gzip' length 392413 bytes (383 KB)
==================================================
downloaded 383 KB
> devtools::install_github("IRkernel/IRkernel")
Skipping install of 'IRkernel' from a github remote, the SHA1 (a862774d) has not changed since last install.
Use `force = TRUE` to force installation
> IRkernel::installspec() # to register the kernel in the current R installation
[InstallKernelSpec] Removing existing kernelspec in /Users/XXX/Library/Jupyter/kernels/ir
[InstallKernelSpec] Installed kernelspec ir in /Users/XXX/Library/Jupyter/kernels/ir
1
2
3
4
5
6
7
8
9
10
11
12
13
14
2
3
4
5
6
7
8
9
10
11
12
13
14
3. 在 jupyter lab 中使用 R
打开 jupyter lab 发现支持新建 R 的 notebook。
参照 Prophet for Ropen in new window,体验 Prophet 在 R 下的预测能力。
reference
- [1] IRkernel. Native R kernel for Jupyteropen in new window