打开APP
userphoto
未登录

开通VIP,畅享免费电子书等14项超值服

开通VIP
Linux(centos 6)安装R语言及R脚本运行

1.安装

转载:
http://blog.csdn.net/qibaoyuan/article/details/6827352

R语言是主要用于统计分析、绘图的语言和操作环境。

官方网站:

http://www.r-project.org/

Windows下面有直接的安装包,直接下载安装很方便,但是对于刚出的CentOS6.0上不能直接通过yum安装R,需要自己编译。

下载页面:

http://ftp.ctex.org/mirrors/CRAN/

在编译R之前,需要通过yum安装以下几个程序:

#yum installgcc-gfortran             #否则报”configure: error: No F77 compiler found”错误

#yum install gccgcc-c++             #否则报”configure: error: C++ preprocessor “/lib/cpp” fails sanitycheck”错误

#yum installreadline-devel         #否则报”–with-readline=yes (default) and headers/libs are notavailable”错误

#yum installlibXt-devel                #否则报”configure: error: –with-x=yes (default) and X11 headers/libsare not available”错误

然后下载源代码,编译

#cd

#wgethttp://ftp.ctex.org/mirrors/CRAN/src/base/R-2/R-2.13.1.tar.gz

#tar zxvf R-2.13.1.tar.gz

#cd R-2.13.1

#./configure

#make

#make install

即可完成编译安装。


自定义安装目录: ./configure--prefix=/data1/R


2.使用:
[jiawei4@secondnamenode183 task5]$ /data1/R-3.0.0/bin/R

R version 3.0.0 (2013-04-03) -- "Masked Marvel"
Copyright (C) 2013 The R Foundation for Statistical Computing
Platform: x86_64-unknown-linux-gnu (64-bit)

R is free software and comes with ABSOLUTELY NO WARRANTY.
You are welcome to redistribute it under certain conditions.
Type 'license()' or 'licence()' for distribution details.

  Natural language support but running in anEnglish locale

R is a collaborative project with many contributors.
Type 'contributors()' for more information and
'citation()' on how to cite R or R packages in publications.

Type 'demo()' for some demos, 'help()' for on-line help, or
'help.start()' for an HTML browser interface to help.
Type 'q()' to quit R.

>

3. 脚本运行:
#cp /data1/R-3.0.0/bin/Rscript /bin/
#vi test.r
#!/bin/Rscript
x<-10
x
# Rscript test.r
[1] 10



本站仅提供存储服务,所有内容均由用户发布,如发现有害或侵权内容,请点击举报
打开APP,阅读全文并永久保存 查看更多类似文章
猜你喜欢
类似文章
【热】打开小程序,算一算2024你的财运
CentOS6.6源码编译升级GCC至4.8.2
centos 6 升级gcc
CentOS 7下的软件安装方法及策略 · SeisMan
linux命令的使用
Linux
jmeter压测学习2-linux运行jmeter环境
更多类似文章 >>
生活服务
热点新闻
分享 收藏 导长图 关注 下载文章
绑定账号成功
后续可登录账号畅享VIP特权!
如果VIP功能使用有故障,
可点击这里联系客服!

联系客服