Skip to content

Instantly share code, notes, and snippets.

@rBatt
Forked from bselden/installed_pkgs.R
Last active July 20, 2016 19:25
Show Gist options
  • Save rBatt/6eebec3cd1eff352fcbe0e4ebae6e1b5 to your computer and use it in GitHub Desktop.
Save rBatt/6eebec3cd1eff352fcbe0e4ebae6e1b5 to your computer and use it in GitHub Desktop.
### Get a list of all your installed packages (so that you can reinstall them after updating R)
a <- installed.packages()
my_pkgs <- dimnames(a)[[1]]
save(my_pkgs, file="my_pkgs.RData")
# exit R, reopen R, then continue to following
load("my_pkgs.RData")
install.packages("a")
missing_packages <- a[!a%in%installed.packages()]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment