linux centOS下安装R

Linux下安装R比在Windows下复杂多了,主要是前置compiler一大堆,网上一些文章也写得各有不齐,碰了我不少壁~~


安装JDK
yum -y install java-1.7.0-openjdk*
java -version


安装R
假设安装目录为:/root/R-3.2.1
yum -y install wget
wget http://mirror.bjtu.edu.cn/cran/src/base/R-3/R-3.2.1.tar.gz
tar -zxvf R-3.2.1.tar.gz
cd R-3.2.1
yum -y install readline-devel
yum -y install libXt-devel
yum -y install gcc gcc-c++
yum -y install gcc-gfortran
yum -y install libg2c.so.0
cd root
vi .bash_profile
加上:PATH=$PATH:/root/R-3.2.1/bin
source .bash_profile
ldconfig -p
./configure
make clean
make  # 最终应没报错,结束于done
make install  #象cannot stat `NEWS': No such file or directory这类错误可以忽略
R  # 测试
q()


参考:
安装R语言在Linux环境
http://blog.sina.com.cn/s/blog_6cfc336b01018wvl.html
http://blog.itpub.net/21711990/viewspace-1114418/


在linux上使用yum安装JDK

http://blog.chinaunix.net/uid-15463753-id-4252690.html


Q: unable to access index for repository http://cran.rstudio.com/bin/windows/contrib/...
A: install.packages('package_name', dependencies=TRUE, repos='http://cran.rstudio.com/')


你可能感兴趣的:(linux)