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

相关推荐
无忧.芙桃35 分钟前
Linux系统编程(四):用户与权限管理
linux·运维·服务器
最强小杰1 小时前
某 OpenAI 兼容网关上的 `kimi-k3.1-pro`:Cline、Zed 接入与 SSE 排错示例
java·服务器·网络·ai
谙弆悕博士3 小时前
多智能体架构详解:层级树状架构(分级主从型)
运维·架构·大模型·agent·多智能体·langgraph·层级树状
戊本菌4 小时前
进程(三)进程优先级:谁先上 CPU
linux·c语言·硬件架构
aningx5 小时前
Arch 系用 greetd 实现开机自动进 Plasma Wayland,注销自动回桌面
linux
张小姐的猫5 小时前
【基于 WebSocket 的多用户网页五子棋】—— 整合封装服务器模块设计实现2️⃣
服务器·websocket·网络协议
江无行者5 小时前
Linux 服务器 top 命令详解
linux
HMS工业网络5 小时前
工业远程访问的五项安全部署原则
运维·服务器·安全
吴建旭 智宅焕7 小时前
智能家居全国交付中执行端能力评估与分级调度架构设计:从注册数量到交付确定性的系统实现
运维·智能家居·devops
嵌入式 Linux手记7 小时前
一块内存,三种解释:union 的真实用法
linux·c语言·驱动开发·嵌入式