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 小时前
数据集下载(AER 和causaldata R包)
r语言·数据集
道剑剑非道15 小时前
QT 打包安装程序【windeployqt.exe】报错c000007d原因:Conda巨坑
开发语言·qt·conda
学渣6765621 小时前
什么时候使用Python 虚拟环境(venv)而不用conda
开发语言·python·conda
人猿泰飞1 天前
在WSL2+Ubuntu22.04中通过conda pack导出一个conda环境包,然后尝试导入该环境包
conda·打包环境
tianyunlinger1 天前
解决conda虚拟环境安装包却依旧安装到base环境下
conda
szial1 天前
如何在 Conda 环境中降级 Python 版本:详细指南
python·conda
张3蜂1 天前
Jupyter Notebook 全面介绍:从原理到实战部署
ide·python·jupyter
悲喜自渡7211 天前
Pytorch(无CPU搭建)+Jupyter
人工智能·pytorch·jupyter
老兵发新帖2 天前
Ubuntu 上安装 Conda
linux·ubuntu·conda
Chh07152 天前
《R语言SCI期刊论文绘图专题计划》大纲
开发语言·r语言