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

相关推荐
软糖姐姐12 小时前
Python开篇——简介、pip和conda
python·conda·pip·数据科学·
酷在前行15 小时前
【R模型】R语言随机森林分类进阶:交叉验证、调参与独立测试(保姆级教程)
随机森林·分类·r语言
天桥下的卖艺者1 天前
使用scitable包,两步生成逆概率删失权重(IPCW)
数据库·r语言
sphw1 天前
nixnb: Jupyter Notebook 优雅分享
ide·人工智能·jupyter
puamac1 天前
Conda + CUDA 环境安装与使用完全指南
conda
编程阿峰1 天前
Python 环境配置(二)安装jupyter、matplotlib、numpy库
开发语言·python·jupyter·numpy·matplotlib
叶 落2 天前
Mac 通过 Miniconda 安装 Python
python·macos·conda·miniconda
冰心孤城2 天前
Conda、Anaconda、Miniconda对比分析
conda
不明觉厉二十年2 天前
uv Windows配置
conda·pip
AAIshangyanxiu2 天前
R 语言耦合遥感技术的水环境综合评估完整技术体系,水质水深水温定量反演方法
开发语言·r语言·遥感水文·水文遥感·r语言遥感