編譯安裝R+Rstudio步驟
作為前端,由於公司需要,現在每天和linux打交道,昨天建立R環境,安裝RStudio,文件並不很完善,現在我執行的步驟放過來希望對需求的碼農們有點幫助。
首先,安裝之前需要下載一些包
>yum install gcc
> yum install gcc-c++
> yum install gcc-gfortran
>yum install pcre-devel
>yum install tcl-devel
>yum install zlib-devel
>yum install bzip2-devel
>yum install readline-devel
>yum install libXt-devel
>yum install tk-devel
>yum install tetex-latex
>yum install libcurl-devel
>yum install openssl-devel
>yum install libxml2-devel
>yum install blas-devel
>yum install lapack-devel
>yum install libicu-devel
>yum install texinfo-tex
然後,需要安裝epel-release-6-8.noarch.rpm
>rpm –ivh epel-release-6-8.noarch.rpm
接下來呢
1,把R包放進目錄下eg:/home/zhangyali/Rstudio/R-3.2.3.tar.gz
>tar -zvxf R-3.2.3.tar.gz
>./configure --enable-R-shlib=yes --with-libpng-x=no --with-tcltk --prefix=/usr/lib/R
>make
>make install
2,新增環境變數
> cd /etc
> vim prifile
新增環境變數
export R_HOME=/usr/lib/R
export PATH=$R_HOME/bin:$PATH
3,啟動R,直接到根目錄下輸入R進行啟動
>R
4,安裝rJava
>install.packages("rJava")
>install.packages("devtools")
6, 安裝sparkR包
>library(devtools)
>install_github("amplab-extras/SparkR-pkg", subdir="pkg")
>quit()
7,安裝視覺化介面RSTUDIO-SERVER
>wget https://download2.rstudio.org/rstudio-server-rhel-0.99.896-x86_64.rpm
>yum install --nogpgcheck rstudio-server-rhel-0.99.896-x86_64.rpm
閒暇之餘註冊了一個公眾號,日常趣事及烘焙小食教程,感興趣的可以關注,非常感謝,有什麼建議也歡迎指出