linux 系统中可以这样安装指定版本的R

 

软件包安装:

 

001、系统

[root@localhost test01]# cat /etc/redhat-release        ## 系统
CentOS Linux release 8.4.2105

。 

 

002、安装epel软件源

[root@localhost test01]# yum install -y https://dl.fedoraproject.org/pub/epel/epel-release-latest-8.noarch.rpm

 。

 

003、设置R版本环境变量:

[root@localhost test01]# export R_VERSION=4.3.2                   ## 设置R版本环境变量

 。

 

004、下载R rpm安装包

[root@localhost software]# curl -O https://cdn.rstudio.com/r/centos-8/pkgs/R-${R_VERSION}-1-1.x86_64.rpm
## 下载R rpm安装包

 

005、安装 R rpm安装包

[root@localhost software]# yum install -y R-${R_VERSION}-1-1.x86_64.rpm   ## 安装R rpm安装包

 

006、默认的安装目录为 :

/opt/R/4.3.2

 

007、修改环境变量

[root@localhost test01]# ln -s /opt/R/${R_VERSION}/bin/R /usr/local/bin/R              ## 修改环境变量
[root@localhost test01]# ln -s /opt/R/${R_VERSION}/bin/Rscript /usr/local/bin/Rscript

 

008、调用测试

复制代码
[root@localhost test01]# R

R version 4.3.2 (2023-10-31) -- "Eye Holes"
Copyright (C) 2023 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.
复制代码

 。

 

reference:

01、https://mp.weixin.qq.com/s?__biz=MzI2MjA1MDQxMg==&mid=2649718839&idx=2&sn=1ebe4cad90fae784b66ffac6281ccf1d&chksm=f24a2734c53dae22a6c9624f9e161a2d60508d37ff28fd5ffdcb07d418cbf830225259159d10&mpshare=1&scene=23&srcid=0403Njio80AX7YtrZsMKcxfO&sharer_shareinfo=f58426efec75ba0383ef2e266035f1d5&sharer_shareinfo_first=f58426efec75ba0383ef2e266035f1d5#rd

 

posted @   小鲨鱼2018  阅读(302)  评论(0编辑  收藏  举报
相关博文:
阅读排行:
· 全程不用写代码,我用AI程序员写了一个飞机大战
· DeepSeek 开源周回顾「GitHub 热点速览」
· 记一次.NET内存居高不下排查解决与启示
· MongoDB 8.0这个新功能碉堡了,比商业数据库还牛
· .NET10 - 预览版1新功能体验(一)
历史上的今天:
2023-04-04 R语言中绘图,将图例设置在绘图区域之外
2022-04-04 ubuntu中 putty连接出现 network error. connection refused
2022-04-04 ubuntu中安装gcc c++编译器
2022-04-04 Peer reports incompatible or unsupported protocol version.
2022-04-04 cache.h:40:18: fatal error: zlib.h: No such file or directory
2022-04-04 bash: git: command not found...
2022-04-04 linux 中实现每两列数据合并为一列数据
点击右上角即可分享
微信分享提示