Painless way to install a new version of R?
Posted
by Shane
on Stack Overflow
See other posts from Stack Overflow
or by Shane
Published on 2009-09-09T20:29:11Z
Indexed on
2010/04/23
22:53 UTC
Read the original article
Hit count: 243
Andrew Gelman recently lamented the lack of an easy upgrade process for R (probably more relevant on Windows that Linux). Does anyone have a good trick for doing the upgrade, from installing the software to copying all the settings/packages over?
This suggestion was contained in the comments and is what I've been using recently. First you install the new version, then run this in the old verion:
#--run in the old version of R
setwd("C:/Temp/")
packages <- installed.packages()[,"Package"]
save(packages, file="Rpackages")
Followed by this in the new version:
#--run in the new version
setwd("C:/Temp/")
load("Rpackages")
for (p in setdiff(packages, installed.packages()[,"Package"]))
install.packages(p)
© Stack Overflow or respective owner