Skip to content

Instantly share code, notes, and snippets.

@n8thangreen
Last active December 15, 2016 09:53
Show Gist options
  • Select an option

  • Save n8thangreen/ed16ec2b1d07f145ccd1 to your computer and use it in GitHub Desktop.

Select an option

Save n8thangreen/ed16ec2b1d07f145ccd1 to your computer and use it in GitHub Desktop.
For transferring all installed packages from old to new version of R (http://stackoverflow.com/questions/1401904/painless-way-to-install-a-new-version-of-r-on-windows)
#--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)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment