Automated Re-Install of Packages for R 3.0

With the big release of R 3.0 today comes an unfortunate side effect of needing to re-install all of your packages. Luckily, R provides a pretty easy method of getting all of your packages into a list for automated re-install.  Here’s how to do it for OSX users with a default install to the Library:

For Windows users, the same general process should work, assuming you change the file reference in the installed.packages function to the proper Windows location.

The one downside to this method is that only packages that are listed on CRAN will be reinstalled, so if you installed anything using devtools, you’ll need to re-install those packages again. But at the very least, the code snippet above is a quick way to re-install most of your packages.

EDIT, 4/4/13: Per Noam below, you can also use a more direct method:

update.packages(ask=FALSE, checkBuilt = TRUE)


Comments

  1. noamross says:

    It seems you can do this with update.packages(ask=FALSE, checkBuilt = TRUE), which will update anything not built with your current version of R.

  2. recology_ says:

    randyzwitch thanks for the tips :)

  3. recology_ says:

    hylopsar thanks dude :)

%d bloggers like this: