zhuangwei的个人博客分享 http://blog.sciencenet.cn/u/zhuangwei

博文

[转载]如何在jupyterlab 中运行R (windows)效果可肩比RSTUDIO

已有 7529 次阅读 2019-3-7 13:18 |个人分类:R|系统分类:科研笔记|文章来源:转载

如何在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://blog.sciencenet.cn/blog-526092-1166203.html

上一篇:R中multisensi和sensitivity 全局敏感性分析的运行代码示例
下一篇:jupyter lab:交互式的编程环境,它可以帮助我们完成一个完成的实验报告
收藏 IP: 14.157.174.*| 热度|

0

该博文允许注册用户评论 请点击登录 评论 (4 个评论)

数据加载中...
扫一扫,分享此博文

Archiver|手机版|科学网 ( 京ICP备07017567号-12 )

GMT+8, 2024-4-26 19:44

Powered by ScienceNet.cn

Copyright © 2007- 中国科学报社

返回顶部