安装R
1.下载R包 https://cran.r-project.org/src/base/R-3/R-3.2.2.tar.gz
2.安装相关依赖包
#yum install gcc-gfortran
#yum install gcc gcc-c++
#yum install readline-devel
#yum install libXt-devel
3.解压R包和安装R
#tar xvf R-3.2.2.tar.gz
#cd R-3.2.2
#./configure
#make
#make install
安装Rstudio
1.到Rstudio官网下载 https://www.rstudio.com/products/rstudio/download/
2.下载对应32或64位的Rstudio
3.下载之后运行
rpm -ivh XX.rpm
可能遇到的问题
1.conftest.c:1:17: fatal error: jni.h: No such file or directory include jni.h
解决方法:
locate jni.h
找到jni.h的文件目录,然后重新make
make -I [jni.h的目录]
2.R shared library (/usr/local/lib/R/lib/libR.so) not found. If this is a custom build of R, was it built with the –enable-R-shlib option?
这个问题困扰了一下,然后从overflow上找到了解决方法。
解决方法是:
第一步、卸载当前R
make uninstall
make clean
第二步、删除当前R的压缩包,重新解压一个
因为试过重新./configure,老是出现config.status: error: cannot find input file: `src/library/base/DESCRIPTION.in’的错误,所以建议卸载干净之后删除当前R包,重新解压一个。
第三步、重新执行安装语句
#./configure --enable-R-shlib=yes
#make -I [jni.h所在目录]
#make install