Created
August 20, 2014 17:16
-
-
Save serverhorror/403a435376247a44748a to your computer and use it in GitHub Desktop.
R Upgrade of Packages between versions
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
| # Install bioConductor in your new R installation | |
| source("http://bioconductor.org/biocLite.R") | |
| chooseBioCmirror() | |
| biocLite() | |
| # install missing R packages for bioConductor | |
| load("installed_old.rda") | |
| tmp <- installed.packages() | |
| installedpkgs.new <- as.vector(tmp[is.na(tmp[,"Priority"]), 1]) | |
| missing <- setdiff(installedpkgs, installedpkgs.new) | |
| for (i in 1:length(missing)) biocLite(missing[i]) | |
| # install missing R packages from CRAN | |
| load("installed_old.rda") | |
| tmp <- installed.packages() | |
| installedpkgs.new <- as.vector(tmp[is.na(tmp[,"Priority"]), 1]) | |
| missing <- setdiff(installedpkgs, installedpkgs.new) | |
| install.packages(missing) | |
| update.packages() |
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
| # Get a list of installed R packages in the old installation | |
| tmp <- installed.packages() | |
| installedpkgs <- as.vector(tmp[is.na(tmp[,"Priority"]), 1]) | |
| save(installedpkgs, file="installed_old.rda") |
Author
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Untested as of yet!