post={"title":"my Blog post","content":"Here‘s my blog post","date":new Date()}
sudo yum install -y gcc
sudo yum install -y glibc-headers
sudo yum install -y libreadline6-dev gfortran
sudo yum install -y readline-devel
sudo yum install -y wget libXt-devel
sudo yum install -y fonts-chinese tcl tcl-devel tclx tk tk-devel
sudo yum install -y mesa-libGLU mesa-libGLU-devel
sudo yum install -y install bzip2-devel
sudo yum install -y install xz-devel.x86_64
sudo yum install -y install pcre-devel
sudo yum install -y install libcurl
sudo yum install -y install libcurl-devel
sudo yum install -y texinfo.x86_64
sudo yum install -y texlive-pdftex-doc.noarch
sudo yum install -y texlive
./configure --enable-R-shlib=yes --with-tcltk --prefix=
make & make install
R语言的安装
首先,从官网上下载3.3.2版本。
wget https://cran.r-project.org/src/base/R-3/R-3.3.2.tar.gz下载完后记得解压,我的习惯是解压在/usr/local下面
tar -zxvf R-3.3.2.tar.gz 然后,编译过mysql的小伙伴肯定也知道,各种环境的安装(gcc等等)。
mysql的各种依赖环境。
sudo yum install -y gcc
sudo yum install gcc-c++
sudo yum install gcc-gfortran
sudo yum install -y glibc-headers
sudo yum install -y libreadline6-dev gfortran
sudo yum install -y readline-devel
sudo yum install -y wget libXt-devel
sudo yum install -y fonts-chinese tcl tcl-devel tclx tk tk-devel
sudo yum install -y mesa-libGLU mesa-libGLU-devel
sudo yum install -y install bzip2-devel
sudo yum install -y install xz-devel.x86_64
sudo yum install -y install pcre-devel
sudo yum install -y install libcurl
sudo yum install -y install libcurl-devel
sudo yum install -y texinfo.x86_64
sudo yum install -y texlive-pdftex-doc.noarch
sudo yum install -y texlive
安装完依赖环境后,准备建立编译后的文件夹R
我习惯建立在usr中
mkdir /usr/local/R接下来,进入R中,准备进行安装了。该R的安装是通过configure进行安装
cd /usr/local/R-3.3.2
./configure --enable-R-shlib=yes --with-tcltk --prefix=/home/hadoop/R环境配置完毕后,可以进行make和安装了
make & make install配置I5的话 大概是15到20分钟。
编译安装完毕后,进行环境配置。
vim /etc/profile
#add R env
R_HOME=/usr/local/R
PATH=$PATH:$R_HOME/bin
source /etc/profile然后直接输入R回车就能进入R的控制台了。
[[email protected] bin]# source /etc/profile
[[email protected] bin]# R
R version 3.3.2 (2016-10-31) -- "Sincere Pumpkin Patch"
Copyright (C) 2016 The R Foundation for Statistical Computing
Platform: x86_64-pc-linux-gnu (64-bit)可能的错误信息
1,如果提示以上安装包未安装的话,请重新安装。
2,缺少什么就使用yum search 缺少的名称,再根据相应的包来进行安装。
3,有可能是其中的Python版本指定有问题。可能需要更新python版本或者内核。
4,没有特别报错,但最后出现
configure: WARNING: you cannot build info or HTML versions of the R manuals ?1
你需要安装
yum install -y texinfo.x86_64
yum install -y texlive-pdftex-doc.noarch?1
?2
5,make的时候一直不动,然后报错’pdflatex’ is needed to make vignettes but is missing on your system.
下载安装yum install -y texlive
people <- read.df(sqlContext, "hdfs://hadoop01:9000/text/access.log", "txt")
sql(hiveContext, "LOAD DATA LOCAL INPATH ‘‘ INTO TABLE src")
----------------------------------------------------------------------------------------------
hist(x$x1)
plot(x1,x2)
plot(x$x1,x$x2)
plot(x$x1,x$x2)
plot(x1,x2)
table(x$x1)
barplot(table(x$x1))
pie(table(x$x1))
boxplot(x$x1,x$x2,x$x3)
boxplot(x[2:4],col=c("red","green","blue"),notch=T)
stars(x[c("x1","x2","x3")])
stars(x[c("x1","x2","x3")],full=T,draw.segment=T)