1. 程式人生 > >R簡易安裝

R簡易安裝

tab x86_64 控制臺 指定 statistic data put amp his

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)

R簡易安裝