准备工作:
anaconda
jupyter
R/Rstudio
安装教程
Rstudio的左下角console输入代码:
install.packages(c('repr', 'IRdisplay', 'evaluate', 'crayon', 'pbdZMQ', 'devtools', 'uuid', 'digest'))
devtools::install_github('IRkernel/IRkernel')
输出结果1:
> install.packages(c('repr', 'IRdisplay', 'evaluate', 'crayon', 'pbdZMQ', 'devtools', 'uuid', 'digest'))
trying URL 'https://mirrors.sjtug.sjtu.edu.cn/cran/bin/windows/contrib/4.2/repr_1.1.6.zip'
Content type 'application/zip' length 124135 bytes (121 KB)
downloaded 121 KB
trying URL 'https://mirrors.sjtug.sjtu.edu.cn/cran/bin/windows/contrib/4.2/IRdisplay_1.1.zip'
Content type 'application/zip' length 34059 bytes (33 KB)
downloaded 33 KB
trying URL 'https://mirrors.sjtug.sjtu.edu.cn/cran/bin/windows/contrib/4.2/evaluate_0.21.zip'
Content type 'application/zip' length 82908 bytes (80 KB)
downloaded 80 KB
trying URL 'https://mirrors.sjtug.sjtu.edu.cn/cran/bin/windows/contrib/4.2/crayon_1.5.2.zip'
Content type 'application/zip' length 162786 bytes (158 KB)
downloaded 158 KB
trying URL 'https://mirrors.sjtug.sjtu.edu.cn/cran/bin/windows/contrib/4.2/pbdZMQ_0.3-10.zip'
Content type 'application/zip' length 992827 bytes (969 KB)
downloaded 969 KB
trying URL 'https://mirrors.sjtug.sjtu.edu.cn/cran/bin/windows/contrib/4.2/devtools_2.4.5.zip'
Content type 'application/zip' length 436903 bytes (426 KB)
downloaded 426 KB
trying URL 'https://mirrors.sjtug.sjtu.edu.cn/cran/bin/windows/contrib/4.2/uuid_1.1-1.zip'
Content type 'application/zip' length 49777 bytes (48 KB)
downloaded 48 KB
trying URL 'https://mirrors.sjtug.sjtu.edu.cn/cran/bin/windows/contrib/4.2/digest_0.6.33.zip'
Content type 'application/zip' length 203986 bytes (199 KB)
downloaded 199 KB
程序包‘repr’打开成功,MD5和检查也通过
程序包‘IRdisplay’打开成功,MD5和检查也通过
程序包‘evaluate’打开成功,MD5和检查也通过
程序包‘crayon’打开成功,MD5和检查也通过
程序包‘pbdZMQ’打开成功,MD5和检查也通过
程序包‘devtools’打开成功,MD5和检查也通过
程序包‘uuid’打开成功,MD5和检查也通过
程序包‘digest’打开成功,MD5和检查也通过
下载的二进制程序包在
C:\Users\w\AppData\Local\Temp\RtmpyqksI5\downloaded_packages里
输出结果2:
> devtools::install_github('IRkernel/IRkernel')
Downloading GitHub repo IRkernel/IRkernel@HEAD
These packages have more recent versions available.
It is recommended to update all of them.
Which would you like to update?
1: All
2: CRAN packages only
3: None
4: htmltools (0.5.5 -> 0.5.6) [CRAN]
Enter one or more numbers, or an empty line to skip updates:
── R CMD build ──────────────────────────────────────────────────────────────────────────────────────────────────
✔ checking for file 'C:\Users\Wong\AppData\Local\Temp\RtmpyqksI5\remotes609024207ead\IRkernel-IRkernel-1eddb30/DESCRIPTION' ...
─ preparing 'IRkernel':
✔ checking DESCRIPTION meta-information ...
─ checking for LF line-endings in source and make files and shell scripts
─ checking for empty or unneeded directories
Removed empty directory 'IRkernel/example-notebooks'
─ building 'IRkernel_1.3.2.9000.tar.gz'
* installing *source* package 'IRkernel' ...
** using staged installation
** R
** inst
** byte-compile and prepare package for lazy loading
** help
*** installing help indices
** building package indices
** testing if installed package can be loaded from temporary location
** testing if installed package can be loaded from final location
** testing if installed package keeps a record of temporary installation path
* DONE (IRkernel)
上面的代码会自动分两步执行,执行完后,在输入如下代码:
#在系统下安装
IRkernel::installspec(user = FALSE)
等待执行完毕,打开jupyter就可以新建R的notebook了。