【已解决】R语言,在线升级
生活随笔
收集整理的這篇文章主要介紹了
【已解决】R语言,在线升级
小編覺得挺不錯的,現在分享給大家,幫大家做個參考.
升級R一直是一件比較痛苦的事情,你需要先安裝新的R,然后在逐一安裝以前裝過的包。最快的辦法也是把以前的包文件夾拷到新的R中,然后在新的版本中運行包更新。由于官方的源一般都提供最新R版本的二進制文件,所以為了更好的穩定性一般也要跟著升級。所以這是一件相對痛苦又不得不做的事情。現在installr程序包提供了自動化升級的途徑,你只需要回答幾個問題就可以將R升級至最新版本,同時相應的程序包也會及時的得到更新。你需要做的只是:
install.packages("installr")
library(installr)
updateR()
然后就會提示最新的R版本,和是否需要拷貝老版本的R程序包目錄,是否需要移除老的程序包目錄以及是否更新新的版本中的程序包。一切搞定之后會提醒你是否需要打開新的RGui,程序會默認將系統的默認R設置為最新版,因此RStudio也會自動切換到最新的R版本。下面是升級之后RStudio的啟動提示
R version 3.1.2 (2014-10-31) -- "Pumpkin Helmet"
Copyright (C) 2014 The R Foundation for Statistical Computing
Platform: x86_64-w64-mingw32/x64 (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.
可以查看一下現在程序包里的庫都是對應哪個版本的R編譯的(圖片見文章開頭):
pkgs<-installed.packages()
plot(as.factor(pkgs[,'Built']),col=2:4,main='Packages built version',ylab='Count of packages')
install.packages("installr")
library(installr)
updateR()
然后就會提示最新的R版本,和是否需要拷貝老版本的R程序包目錄,是否需要移除老的程序包目錄以及是否更新新的版本中的程序包。一切搞定之后會提醒你是否需要打開新的RGui,程序會默認將系統的默認R設置為最新版,因此RStudio也會自動切換到最新的R版本。下面是升級之后RStudio的啟動提示
R version 3.1.2 (2014-10-31) -- "Pumpkin Helmet"
Copyright (C) 2014 The R Foundation for Statistical Computing
Platform: x86_64-w64-mingw32/x64 (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.
可以查看一下現在程序包里的庫都是對應哪個版本的R編譯的(圖片見文章開頭):
pkgs<-installed.packages()
plot(as.factor(pkgs[,'Built']),col=2:4,main='Packages built version',ylab='Count of packages')
可以看到大部分程序包都更新到了最新的R,但是還有不少還停留在大版本號3.1.0上,也有小部分還是3.1.11。總的來看,R的升級還是很成功的,使用起來也很方面。
參考文章:http://bbs.pinggu.org/thread-3722753-1-1.html
總結
以上是生活随笔為你收集整理的【已解决】R语言,在线升级的全部內容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: 【几点总结】开漏极
- 下一篇: 谈谈招聘时我喜欢见到的特质