安装R语言
操作步骤
- 使用PuTTY工具,以root用户登录服务器。
- 执行以下命令进入“/path/to/SRAP”目录。
cd /path/to/SRAP
- 执行以下命令下载R语言源码包。
wget https://cran.r-project.org/src/base/R-4/R-4.2.0.tar.gz
- 执行以下命令解压R语言源码包。
tar xvf R-4.2.0.tar.gz
- 执行以下命令进入解压后的目录。
cd R-4.2.0
- 执行以下命令编译安装。
yum install libXt-devel libX11-devel readline-devel ./configure --prefix=/path/to/SRAP/R_install make make install
- 执行以下命令加载环境变量。
export PATH=/path/to/SRAP/R_install/bin:$PATH export LD_LIBRARY_PATH=/path/to/SRAP/R_install/lib/R/library:$LD_LIBRARY_PATH
- (可选)若用户当前网速较慢,可执行以下命令添加R语言的镜像源。
- 创建“~/.Rprofile”文件。
vi ~/.Rprofile
- 按“i”进入编辑模式,添加以下内容。
options("repos"= c(CRAN="http://mirrors.tuna.tsinghua.edu.cn/CRAN/")) options(BioC_mirror="http://mirrors.tuna.tsinghua.edu.cn/bioconductor/")
- 按“Esc”键,输入:wq!,按“Enter”保存并退出编辑。
- 创建“~/.Rprofile”文件。
父主题: 配置编译环境