更新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版本

相关推荐
bosins2 小时前
彻底解决 WSL 2.7+ 空闲自动关闭/内存回收导致 Docker 中断的问题
linux·docker·wsl·dashboard
LongRunning2 小时前
【Linux】H3网络(二)
linux
国际云,接待3 小时前
华为云 EVS 性能诊断:用 CES、ECS QoS 与 fio 定位 IOPS 和吞吐瓶颈
服务器
xx~t4 小时前
嵌入式学习——ARM1
linux·arm开发·嵌入式硬件·arm
xx~t4 小时前
嵌入式——ARM1(详细篇)
linux·arm开发·嵌入式硬件·arm
我要见SA姐14 小时前
告别 Copilot?Codex 本地化部署指南
运维·数据库·机器学习·oracle·回归
Elastic 中国社区官方博客5 小时前
列式存储并不等同于列式数据库。Columnar 模式为 Elasticsearch 带来了什么
大数据·运维·数据库·elasticsearch·搜索引擎
fengkai45456 小时前
八、Docker详解4-5
运维·docker
智恒百亿7 小时前
RTX 5090 八卡服务器 vs RTX PRO 6000 整机:AI 推理、微调与渲染选型部署指南
运维·服务器·rtx5090
ManageEngineITSM7 小时前
DevOps和ITIL是什么关系?是替代还是互补一文讲清
java·服务器·资产管理·变更管理