Conda安装R环境并在Jupyter Lab中运行

说明:

Conda 安装 R 环境,并在 Jupyter Lab 中运行 R 脚本。

1. 创建环境并安装r-base

创建环境:conda create -n [环境名]
激活环境:conda activate [环境名]
安装 Jupyter Lab:conda install -c conda-forge jupyterlab
安装r-base:conda install r-base=4.4.1(R版本为4.4.1)

2. 安装 R 内核

进入 R 交互环境后,安装:
安装必要的包:install.packages(c('repr', 'IRdisplay', 'evaluate', 'crayon', 'pbdZMQ', 'devtools', 'uuid', 'digest'))
安装 IRkernel: install.packages("IRkernel")
Jupyter Lab 连接 IRkernel:IRkernel::installspec()
修改Jupyter Lab中显示的R环境名称:
jupyter kernelspec list 列出所有内核,找到 [环境名] 对应的 json 文件,修改其中的"display_name": "待显示的环境名称"

显示的默认环境名称为R

修改 json 后环境的名称:

参考:

1\]. https://blog.csdn.net/weixin_45348389/article/details/108359814 \[2\]. https://blog.csdn.net/guoyuzhu_2013/article/details/106604447

相关推荐
漂亮_大男孩11 小时前
conda|如何通过命令行在mac上下载conda
macos·conda
Biomamba生信基地17 小时前
R语言绘图神器| ggplot2与其基本用法介绍
开发语言·信息可视化·r语言·生信·医药
天桥下的卖艺者1 天前
R语言基于shiny开发随机森林预测模型交互式 Web 应用程序(应用程序)
前端·随机森林·r语言·shiny
小火柴1231 天前
利用R语言绘制直方图
开发语言·r语言
zhangfeng11332 天前
R语言 读取tsv的三种方法 ,带有注释的tsv文件
开发语言·r语言·生物信息
Tiger Z2 天前
《R for Data Science (2e)》免费中文翻译 (第9章) --- Layers(2)
r语言·数据科学·中文翻译
海大哥3 天前
深入解析Java中HashMap的工作原理与性能优化策略
r语言
万粉变现经纪人3 天前
如何解决 pip install -r requirements.txt 约束文件 constraints.txt 仅允许固定版本(未锁定报错)问题
开发语言·python·r语言·django·beautifulsoup·pandas·pip
万粉变现经纪人3 天前
如何解决 pip install -r requirements.txt 无效可编辑项 ‘e .‘(-e 拼写错误)问题
开发语言·python·r语言·beautifulsoup·pandas·pip·scipy