1. 下载源码包

    • 在http://cran.r-project.org/mirrors.html,选择一个国内镜像下载需要的版本,比如:http://mirror.lzu.edu.cn/CRAN/src/base/R-3/,这儿我下载了R-3.1.3版的源码,大约20多M,很快就下载完成。
  2. 解压源码
    • 压缩包我放在/user/local目录下,进入此目录后运行命令:
    • tar xzf R-3.1.3.tar.gz
    • 解压到当前目录
  3. 检查编译环境及编译
    • 进入目录
    • cd R-3.1.3
    • ./configure
    • checking for g++... no
      checking for c++... no

      configure: error: No F77 compiler found
      ...会有一大堆不满足的条件
    • 安装对应的依赖即可
      yum install gcc-c++ (如果没有安装c和c++的编译器)
      yum install readline-devel
      yum install libXt-devel
      yum install gcc-gfortran (解决configure: error: No F77 compiler found 错误)
    • ./configure  --enable-R-shlib --prefix=/usr/R-3.1.3
      make
      make install
    • 将/usr/local/R-3.1.3/bin加入用户或系统环境变量的path里边:
         比如:vim /etc/profile
         增加这一行:export PATH=/usr/R-3.1.3/bin:$PATH
         source /etc/profile
  4. 测试
>R
即可看到如下信息:
简单测试
ok!
R version 3.1.3 (2015-03-09) -- "Smooth Sidewalk"
Copyright (C) 2015 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 an English 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. > x<-c(1,2,3)
> y<-c(102,299,301)
> model<-lm(y~x)
> summary(model) Call:
lm(formula = y ~ x) Residuals:
1 2 3
-32.5 65.0 -32.5 Coefficients:
Estimate Std. Error t value Pr(>|t|)
(Intercept) 35.00 121.60 0.288 0.822
x 99.50 56.29 1.768 0.328 Residual standard error: 79.61 on 1 degrees of freedom
Multiple R-squared: 0.7575, Adjusted R-squared: 0.5151
F-statistic: 3.124 on 1 and 1 DF, p-value: 0.3278 > proc.time()
user system elapsed
0.300 0.024 97.456
>
 

最新文章

  1. backbone模型层浅析
  2. Java算法-符号&amp;
  3. Treap实现山寨set
  4. DataSnap 用TStream 传递大数据 返回流大小为-1的情况
  5. linux性能分析工具
  6. HDU 4997 Biconnected (状态压缩DP)
  7. centos 升级 python后 python-setuptools pip 安装依赖报错
  8. object
  9. 有趣的js题目
  10. 【BZOJ 1791】 [Ioi2008]Island 岛屿
  11. CSS2书写顺序
  12. MyBatis中的大于、小于、like等符号写法
  13. Python 基础 (单、双引号区别) 不断补充
  14. java语法基础(总结)
  15. Linux-02
  16. Ubuntu 16.04下Samba服务器搭建和配置(配截图)
  17. BZOJ 4584 【APIO2016】 赛艇
  18. 菜鸟教程之工具使用——Git的基本使用
  19. 工具-VIM配置
  20. [洛谷P1131][ZJOI2007]时态同步

热门文章

  1. json处理总结(前端js和后端java)
  2. java中创建字符串的两种方式(“”与new String())及区别
  3. sql inner join , left join, right join , union,union all 的用法和区别
  4. js②
  5. C#与Java在继承静态类上的区别
  6. 浅谈 Struts2 面试题收藏
  7. adb -s emulator-5554 install JDKCast-PAP.apk
  8. 自定义Toast解决快速点击时重复弹出,排队无止尽
  9. 【Learning Python】【第二章】Python基础类型和基础操作
  10. Maven构件解析(转)