Skip to content

Instantly share code, notes, and snippets.

@MCMaurer
Last active January 25, 2019 06:05
Show Gist options
  • Save MCMaurer/20b384bf1caf7aabd43f3989aa479bb4 to your computer and use it in GitHub Desktop.
Save MCMaurer/20b384bf1caf7aabd43f3989aa479bb4 to your computer and use it in GitHub Desktop.
# run this BEFORE you reinstall R/RStudio
old_packages <- list.files(.libPaths())
saveRDS(old_packages, "test_old_packages.rds")
# now you close RStudio and reinstall the new R and RStudio
# now you run THIS after you've installed R and RStudio anew
old_pkg_import <- readRDS("test_old_packages.rds")
pkgs_to_install <- unique(old_pkg_import)
install.packages(pkgs_to_install)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment