Last active
December 15, 2015 20:48
-
-
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
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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