更新R版本到4.xxx

python 复制代码
conda create -n r4-base
conda activate r4-base
conda config --add channels conda-forge
conda install -c conda-forge r-base #或者 conda install -c conda-forge r-base=4.1.3

安装后进入R环境

python 复制代码
R

结果仍然是3.xxx版本

python 复制代码
(r4-base) /mnt/workspace/wzf> R

R version 3.6.3 (2020-02-29) -- "Holding the Windsock"
Copyright (C) 2020 The R Foundation for Statistical Computing
Platform: x86_64-pc-linux-gnu (64-bit)

R is free software and comes with ABSOLUTELY NO WARRANTY.
You are welcome to redistribute it under certain conditions.
Type 'license()' or 'licence()' for distribution details.

  Natural language support but running in an English locale

R is a collaborative project with many contributors.
Type 'contributors()' for more information and
'citation()' on how to cite R or R packages in publications.

Type 'demo()' for some demos, 'help()' for on-line help, or
'help.start()' for an HTML browser interface to help.
Type 'q()' to quit R.

怀疑是新安装的R没有添加到路径中

查看R环境:

python 复制代码
(r4-base) /mnt/workspace/wzf> whereis R
R: /usr/bin/R /usr/lib/R /etc/R /usr/local/lib/R /usr/share/R /home/pai/envs/r4-base/bin/R

查看路径:

python 复制代码
echo $PATH

果然不在路径中,将/home/pai/envs/r4-base/bin/R添加到路径

python 复制代码
r4-base) /mnt/workspace/wzf> export PATH="/home/pai/envs/r4-base/bin:$PATH"

重新进入R环境,成功变成4.xxx版本

相关推荐
黑贝是条狗12 分钟前
Excel批量处理工具
linux·运维·excel
实心儿儿17 分钟前
Linux —— 进程间通信 - 匿名管道
linux·运维·服务器
LuDvei18 分钟前
Ubuntu 20.04 安装 Android Studio 详细指南
linux·ubuntu·android studio
枕星而眠22 分钟前
Linux 共享内存与信号量全解析:原理、实践与避坑指南
linux·c语言·开发语言·后端·ubuntu
wgl66652026 分钟前
进程间通信
linux·运维·服务器
悠悠1213827 分钟前
从0到1掌握Ansible:让自动化运维不再是梦想
运维·自动化·ansible
璞华Purvar27 分钟前
VC PE投资管理系统选型的核心考量因素有哪些?(2026选型指南)
大数据·运维·人工智能
b55t4ck28 分钟前
Linux CVE-2026-31431(Copy Fail)漏洞深入复现分析(待完善).md
linux·运维·服务器
前端老曹29 分钟前
Linux 指令完整版
linux·运维·服务器
ChaoFeiLi29 分钟前
Linux离线安装NVIDIA Container Toolkit
linux·服务器