Skip to content

Installing packages into updated R

5 messages · Mike Prager, Gabor Grothendieck, Uwe Ligges +2 more

#
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?
#
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:
#
Michael H. Prager wrote:
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,
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:

            

  
    
#
On Ti, 2005-12-20, 16:11, Michael H. Prager skrev:
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