熱門文章

2018年4月25日 星期三

R 101_安裝 and 安裝舊版既有套件

Step01.至 https://cran.r-project.org/

Step02.選擇Download R for Windows

Step03.選擇base


 Step04.點選 Download R X.X.X(版本) for Windows
 Step05.將舊版R套件安裝至新版

  •  先進入舊版的 R,執行
oldPkgs = installed.packages()
oldPkgs = oldPkgs[,"Package"]
save(oldPkgs,file="d:/oldPkgs.Rdata")

  • 進入新版 R 3.5.0,執行
# 扣除新版已經安裝的基本套件
pkgDiff = setdiff(oldPkgs,basePkg)
install.packages(pkgDiff)

oldPkgs = installed.packages()
oldPkgs = oldPkgs[,"Package"]
save(oldPkgs,file="d:/oldPkgs.Rdata")

-----------------------------
 Ref:台灣R軟體Club https://www.facebook.com/groups/1210634969026548/