A minor inconvenience in updating an R installation is remembering which packages were installed previously. Has anyone written a script to inspect a previous installation, then get & install the same packages into the new installation? -- Michael Prager NOAA Center for Coastal Fisheries and Habitat Research Beaufort, North Carolina 28516 Opinions expressed are personal, not official. No government endorsement of any product is made or implied.
In http://cran.r-project.org/contrib/extra/batchfiles/batchfiles_0.2-5.zip are two Windows XP batch files: movedir.bat copydir.bat which will move the packages (which is much faster and suitable if you don't need the old version of R any more) or copy the packages (which takes longer but preserves the old version). On 12/20/05, Michael H. Prager <Mike.Prager at noaa.gov> wrote:> A minor inconvenience in updating an R installation is remembering which > packages were installed previously. Has anyone written a script to > inspect a previous installation, then get & install the same packages > into the new installation? > > -- > > Michael Prager > NOAA Center for Coastal Fisheries and Habitat Research > Beaufort, North Carolina 28516 > Opinions expressed are personal, not official. No > government endorsement of any product is made or implied. > > ______________________________________________ > R-help at stat.math.ethz.ch mailing list > https://stat.ethz.ch/mailman/listinfo/r-help > PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html >
Michael H. Prager wrote:> A minor inconvenience in updating an R installation is remembering which > packages were installed previously. Has anyone written a script to > inspect a previous installation, then get & install the same packages > into the new installation?x <- installed.packages()[,1] install.packages(x) Uwe Ligges
This is one reason we normally recommend that you install into a separate library. Then update.packages(checkBuilt = TRUE) is all that is needed. However,> foo <- installed.packages() > as.vector(foo[is.na(foo[, "Priority"]), 1])will give you a character vector which you can feed to install.packages(), so it's not complex to do manually. On Tue, 20 Dec 2005, Michael H. Prager wrote:> A minor inconvenience in updating an R installation is remembering which > packages were installed previously. Has anyone written a script to > inspect a previous installation, then get & install the same packages > into the new installation?-- Brian D. Ripley, ripley at stats.ox.ac.uk Professor of Applied Statistics, http://www.stats.ox.ac.uk/~ripley/ University of Oxford, Tel: +44 1865 272861 (self) 1 South Parks Road, +44 1865 272866 (PA) Oxford OX1 3TG, UK Fax: +44 1865 272595
On Ti, 2005-12-20, 16:11, Michael H. Prager skrev:> A minor inconvenience in updating an R installation is remembering which > packages were installed previously. Has anyone written a script to > inspect a previous installation, then get & install the same packages > into the new installation?If the previous installation is still alive, fire it up and pS <- packageStatus() pkgs <- pS$inst$Package[!pS$inst$Priority %in% c("base", "recommended")] save(pkgs, file = "foo") In the new installation, load("foo") install.packages(pkgs) HTH Henric