Skip to content

Instantly share code, notes, and snippets.

@gu-mi
Last active December 15, 2015 20:48
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save gu-mi/5320950 to your computer and use it in GitHub Desktop.
Save gu-mi/5320950 to your computer and use it in GitHub Desktop.
On a Mac OS, re-install R packages installed for R 2.15.X, when upgrading to R 3.0.0
# http://randyzwitch.com/automated-re-install-of-packages-for-r-3-0/
# if using RStudio, make sure to unload all packages that are pre-loaded except for utils:
# we have to use the install.packages() function in utils for the re-installation
# Get currently installed packages
package_df <- as.data.frame(installed.packages("/Library/Frameworks/R.framework/Versions/2.15/Resources/library"))
package_list <- as.character(package_df$Package)
package_list # get a package list installed on R 2.15.X
length(package_list)
# Re-install Install packages
install.packages(package_list)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment