There's a package that's only working under a old R version (2.15.3), so I installed this version but sharply find I lost all the installed packages (~100). I am using MAC OS X 10.8 and wondering is there a way to restored all the previously installed packages?
Asked
Active
Viewed 2,055 times
1 Answers
4
This was the easiest approach I found when I upgraded from 2.15 to 3.0. Code is from here. You can do this after you install R 3.0, because your 2.15 package library will still exist (as long as you don't uninstall it):
# Get list of installed packages for R 2.15
package_df <- as.data.frame(installed.packages("/Library/Frameworks/R.framework/Versions/2.15/Resources/library"))
package_list <- as.character(package_df$Package)
# Re-install the packages to your new version
install.packages(package_list)
It looks like you want to go from a newer version to an older version, so just put in the correct path to the packages for your current version then use that list to install them in the version you're switching to. If you store your packages in a different directory, just point to whatever directory you use. If you want to check where R stores your packages, use .libPaths()
.

eipi10
- 91,525
- 24
- 209
- 285