R是什么

简介

R是用于统计分析、绘图的语言和操作环境。R是属于GNU系统的一个自由、免费、源代码开放的软件,它是一个用于统计计算和统计制图的优秀工具。

配置编译流程

1.配置编译环境

1)安装wget工具。

apt-get install wget -y

2)安装依赖库和工具。

apt-get install Fortran* libreadline6-dev libxt-dev libbz2-dev liblzma-dev libghc-curl-dev libghc-zlib-dev libpcre++-dev -y

对于ubuntu下的 镜像 源问题,请参考https://bbs.huaweicloud.com/forum/thread-22424-1-1.html完成修复

2.获取源码

获取“R-3.6.1”源码包。

cd /usr/local/src
wget https://mirrors.tuna.tsinghua.edu.cn/CRAN/src/base/R-3/R-3.6.1.tar.gz

3.编译和安装

1)解压软件包。

cd /usr/local/src
tar -zxvf R-3.6.1.tar.gz

2)进入R的安装目录。

cd /usr/local/src/R-3.6.1/

3)安装R。

./configure --prefix=/usr/ --enable-R-shlib
make -j8 && make install

4)配置R环境变量。

vi /etc/profile

添加如下内容:

export PATH=$PATH://usr/local/src/R-3.6.1/bin

保存退出,执行如下语句使得环境变量生效。

source /etc/profile

4.运行和验证

1)R一般配合桌面使用,建议参考《Xfce安装指南》,安装好桌面后,然后通过桌面进入,打开终端执行。

R

回显内容如下:

root@ecs-ubuntu-xfce# R
 
R version 3.6.1 (2019-07-05) -- "Action of the Toes"
Copyright (C) 2019 The R Foundation for Statistical Computing
Platform: aarch64-unknown-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.

2)检查安装。

执行以下命令:

vol=trees[["Girth"]]^2*trees[["Height"]]/(4*pi)
hist(vol,col=1)

​弹出界面,表示安装成功。

上一篇:怎样购买并登录linux弹性云服务器 下一篇:面对直播云服务行业挑战,华为云视频是怎么做的?