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

相关推荐
阿尔帕兹7 小时前
安装Conda并配置PX4无人机仿真环境
conda·px4
x_lrong14 小时前
Linux虚拟机配置jupyter环境并在宿主机访问
linux·运维·笔记·jupyter·虚拟机
24kHT14 小时前
conda以及Jupyter notebook的使用
windows·jupyter·conda
图灵信徒18 小时前
R语言绘图与可视化第六章总结
python·数据挖掘·数据分析·r语言
一个数据大开发2 天前
【零基础一站式指南】Conda 学习环境准备与 Jupyter/PyCharm 完全配置
学习·jupyter·conda
nvd113 天前
asyncio.run() vs asyncio.gather():启动器与聚合器, 为何Jupyter notebook里能直接使用await?
开发语言·python·jupyter
EEG小佬3 天前
Jupyter选择内核时如何找到虚拟环境
ide·python·jupyter
Tiger Z3 天前
《R for Data Science (2e)》免费中文翻译 (第12章) --- Logical vectors(1)
数据分析·r语言·数据科学·免费书籍
半夏微凉半夏殇3 天前
cmd控制台出现 系统找不到指定的路径。
conda
AI纪元故事会3 天前
《目标检测全解析:从R-CNN到DETR,六大经典模型深度对比与实战指南》
人工智能·yolo·目标检测·r语言·cnn