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

相关推荐
无心水1 天前
【Python实战进阶】2、Jupyter Notebook终极指南:为什么说不会Jupyter就等于不会Python?
python·jupyter·信息可视化·binder·google colab·python实战进阶·python工程化实战进阶
Pocker_Spades_A1 天前
在家写的代码,办公室接着改?Jupyter通过cpolar实现远程访问这么玩
ide·python·jupyter
图灵信徒1 天前
R语言第七章线性回归模型
数据挖掘·数据分析·r语言·线性回归
辣椒酱.2 天前
jupyter相关
python·jupyter
王 富贵3 天前
Conda常用命令大全
windows·conda
慕无言3 天前
pycharm2024选择conda环境
conda
翰佰尔HiOmics云分析3 天前
转录组分析实战:GO与KEGG富集分析原理及R语言实现
r语言·转录组·krgg
Q一件事3 天前
R语言处理潜在蒸散nc数据
开发语言·r语言
Python大数据分析@4 天前
数据分析为什么常用Jupyter而不是直接使用Python脚本或Excel?
python·jupyter·数据分析
灯下夜无眠4 天前
conda打包环境上传spark集群
大数据·spark·conda