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

相关推荐
沐芊屿1 分钟前
华为交换机配置M-LAG
服务器·网络·华为
枷锁—sha5 分钟前
【SRC】越权漏洞检测
运维·服务器·网络·安全·网络安全·系统安全
UP_Continue20 分钟前
Linux--进程控制
linux·运维·服务器
请输入蚊子21 分钟前
«操作系统真像还原» 第二章 编写MBR主引导记录
linux·汇编·操作系统·bochs·操作系统真像还原
等什么君!39 分钟前
docker -数据卷技术
运维·docker·容器
188号安全攻城狮1 小时前
【PWN】HappyNewYearCTF_8_ret2csu
linux·汇编·安全·网络安全·系统安全
喵叔哟1 小时前
02-CSharp基础语法快速入门
服务器
Yana.nice2 小时前
openssl将证书从p7b转换为crt格式
java·linux
AI逐月2 小时前
tmux 常用命令总结:从入门到稳定使用的一篇实战博客
linux·服务器·ssh·php
想逃离铁厂的老铁2 小时前
Day55 >> 并查集理论基础 + 107、寻找存在的路线
java·服务器