1.
安装
转载: R语言是主要用于统计分析、绘图的语言和操作环境。 官方网站: http://www./ Windows下面有直接的安装包,直接下载安装很方便,但是对于刚出的CentOS6.0上不能直接通过yum 安装R,需要自己编译。 下载页面: http://ftp./mirrors/CRAN/ 在编译R之前,需要通过yum安装以下几个程序:
#yum install
gcc-gfortran
#yum install gcc
gcc-c++
#yum install
readline-devel
#yum install
libXt-devel 然后下载源代码,编译 #cd #wget http://ftp./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
[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. 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
|
|