This function is part programming exercise and part solution to R upgrades. Only install.packages() pkgs param is supported. For devtools::install_* functions, only the first parameter, usually repo, is supported. If you need something more advanced, there are plenty of similar functions already written.

reinstall_packages(pkgs = my_packages)

Arguments

pkgs
a list of packages to install. Packages installed with devtools::install_* functions are specified as a character vector of 2 strings. The first string is the suffix to complete the install funciton name. The second string is the path to the package. If this param is not specified, the set is defaulted to dgutils::my_packages.

Value

TRUE

Details

Each R release has its own library, /Library/Frameworks/R.framework/Versions/x.x/Resources/library. To avoid redoing the package installs into the new R library, I added this entry to .Renviron:

R_LIBS_USER=~/Library/R/3.x/library/
and this function to make managing multiple computers eaiser.

Future Development

It's possible that my_packages will become an option.