与this问题类似,但没有可行的答案。
我试图在linux redhat 6.6上使用Rscript,但是Rscript使用了不正确的R版本。如何让Rscript使用最新的R版本?
运行Rscript --version
会产生
R scripting front-end version 2.13.0 (2011-04-13)
运行R
会产生:
R version 3.2.3 (2015-12-10) -- "Wooden Christmas-Tree"
Copyright (C) 2015 The R Foundation for Statistical Computing
Platform: x86_64-pc-linux-gnu (64-bit)
R和Rscript的结果如下:
[]$ whereis R
R: /usr/local/bin/R
[]$ whereis Rscript
Rscript: /usr/local/bin/Rscript
产生以下结果:
[rd02@ipgrd02 ~]$ which Rscript
/usr/local/bin/Rscript
[rd02@ipgrd02 ~]$ which R
/usr/local/bin/R
rpm -qa |egrep ^R
产生以下结果:
[rd02 @ ipgrd02~] $ rpm -qa | egrep ^ R.
Red_Hat_Enterprise_Linux-RELEASE_NOTES -6-烯-US-6-2.el6.noarch
我认为它与bashrc / bash_profile有关,但我找不到任何可以帮助我的谷歌。
答案 0 :(得分:0)
在我看来,您已经在包管理器外安装了R。在CentOS / RedHat 7.x平台上,相同的安装如下所示:
#which Rscript
/bin/Rscript
#which R
/bin/R
#rpm -qa | egrep ^R
R-core-3.2.3-4.el7.x86_64
R-3.2.3-4.el7.x86_64
R-core-devel-3.2.3-4.el7.x86_64
R-devel-3.2.3-4.el7.x86_64
R-java-3.2.3-4.el7.x86_64
R-java-devel-3.2.3-4.el7.x86_64
#whereis R
R: /usr/bin/R /usr/lib64/R /usr/include/R /usr/share/R /usr/share/man/man1/R.1.gz
#whereis Rscript
Rscript: /usr/bin/Rscript /usr/share/man/man1/Rscript.1.gz
您是否介意澄清软件包的安装方式?
我的系统上有以下内容:
#Rscript --version
R scripting front-end version 3.2.3 (2015-12-10)
#R
R version 3.2.3 (2015-12-10) -- "Wooden Christmas-Tree"
Copyright (C) 2015 The R Foundation for Statistical Computing
Platform: x86_64-redhat-linux-gnu (64-bit)