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

相关推荐
C_心欲无痕3 分钟前
ts - tsconfig.json配置讲解
linux·前端·ubuntu·typescript·json
冰西瓜60044 分钟前
国科大2025操作系统高级教程期末回忆版
linux
HIT_Weston1 小时前
93、【Ubuntu】【Hugo】搭建私人博客:面包屑(一)
linux·运维·ubuntu
cuijiecheng20182 小时前
Linux下Beyond Compare过期
linux·运维·服务器
喵叔哟2 小时前
20.部署与运维
运维·docker·容器·.net
HIT_Weston2 小时前
92、【Ubuntu】【Hugo】搭建私人博客:侧边导航栏(六)
linux·运维·ubuntu
CodeAllen嵌入式2 小时前
Windows 11 本地安装 WSL 支持 Ubuntu 24.04 完整指南
linux·运维·ubuntu
期待のcode2 小时前
前后端分离项目 Springboot+vue 在云服务器上的部署
服务器·vue.js·spring boot
AI 智能服务2 小时前
第6课__本地工具调用(文件操作)
服务器·人工智能·windows·php
码农小韩4 小时前
基于Linux的C++学习——指针
linux·开发语言·c++·学习·算法