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 @ 2024-04-04 21:56  小鲨鱼2018  阅读(70)  评论(0编辑  收藏  举报