庄伟
[转载]如何在jupyterlab 中运行R (windows)效果可肩比RSTUDIO
2019-3-7 13:18
阅读:7746

如何在jupyterlab 中运行R 

Installing RKernel on Windows JupyterLab

本文转载自https://qiita.com/crowdy/items/3738ebe1edb95839753f


准备工作:

安装anaconda, 下载地址:https://www.anaconda.com/distribution/


安装完毕后,打开anaconda Prompt

输入:

conda install -c conda-forge r

捕获.PNG


开始安装

installing R with conda

image.png

Proceed ([y]/n)? y

image.png

run R console

which r r

image.png

install IRKernel

install.packages(c('repr', 'IRdisplay', 'evaluate', 'crayon', 'pbdZMQ', 'devtools', 'uuid', 'digest')) devtools::install_github('IRkernel/IRkernel')

image.png

image.png

install Rkernel on current environment

IRkernel::installspec()

image.png

exit RTerm with q() coomand and run jupyter lab again.

image.png

image.png

check Rkernel

image.png

ref

irkernel installation
https://irkernel.github.io/installation/

Producing Simple Graphs with R
https://www.harding.edu/fmccown/r/


以上安装过程,在不同系统中可能存在差异,请根据安装提示完成。



使用过程的补充提示:

(1)没有指定工作文件夹的情况下,jupyter lab默认是打开C盘,我们平时工作的代码文件通常是放在D盘或其他盘的文件夹中的,如何在Jupyter lab中打开到指定的工作文件夹:

可以在Anaconda Prompt 中改变工作路径,如,我们的工作文件夹是D:\T\R-Graph-gallery,可以输入图中的命令:


d:

cd T\R-Graph-gallery

jupyter lab

捕获2.PNG

即可打开jupyter lab

捕获3.PNG


双夹打开我们已经建好的ipynb文件,这个文件可以执行R

5.png


(2)jupyter lab背景设置

长期用代码,可以把背景变成黑色,在Setting\Jupyterlab Theme中设置

转载本文请联系原作者获取授权,同时请注明本文来自庄伟科学网博客。

链接地址:https://wap.sciencenet.cn/blog-526092-1166203.html?mobile=1

收藏

分享到:

当前推荐数:0
推荐到博客首页
网友评论4 条评论
确定删除指定的回复吗?
确定删除本博文吗?