更新R版本到4.xxx

本文讲述了如何在Linux系统上通过Conda安装R4.x版本,解决初始安装3.x版本的问题,重点在于如何添加新安装的R环境到系统路径中以便于使用。
摘要由CSDN通过智能技术生成

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环境

R

结果仍然是3.xxx版本

(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环境:

(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

查看路径:

echo $PATH

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

r4-base) /mnt/workspace/wzf> export PATH="/home/pai/envs/r4-base/bin:$PATH"

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

  • 6
    点赞
  • 9
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值