Quick-Tip: How to Programmatically Re-install Packages in R

 

Get the 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)

 

Re-install  packages:

install.packages(package_list)