Skip to content

Instantly share code, notes, and snippets.

@RobertMyles
Last active January 10, 2017 19:23
Show Gist options
  • Save RobertMyles/72757a6a3a92e9227d7e20e8d2246fd1 to your computer and use it in GitHub Desktop.
Save RobertMyles/72757a6a3a92e9227d7e20e8d2246fd1 to your computer and use it in GitHub Desktop.
Updated R today and realized that I lost a load of packages that I had installed previously. Instead of re-installing them one by one, I just did this (it works for Mac OS, it'll be slightly different on Windows):
Old_packList <- as.list(installed.packages("/Library/Frameworks/R.framework/Versions/3.2/Resources/library"))
# here, my R version was 3.2. Change it for the R version you want the packages from!
Old <- as.character(Old_packList)
install.packages(Old)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment