Installing packages into updated R

classic Classic list List threaded Threaded
5 messages Options
Reply | Threaded
Open this post in threaded view
|

Installing packages into updated R

Mike Prager
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.

______________________________________________
[hidden email] mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html
Reply | Threaded
Open this post in threaded view
|

Re: Installing packages into updated R

Gabor Grothendieck
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 <[hidden email]> 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.
>
> ______________________________________________
> [hidden email] mailing list
> https://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html
>

______________________________________________
[hidden email] mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html
Reply | Threaded
Open this post in threaded view
|

Re: Installing packages into updated R

Uwe Ligges
In reply to this post by Mike Prager
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

______________________________________________
[hidden email] mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html
Reply | Threaded
Open this post in threaded view
|

Re: Installing packages into updated R

Brian Ripley
In reply to this post by Mike Prager
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,                  [hidden email]
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

______________________________________________
[hidden email] mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html
Reply | Threaded
Open this post in threaded view
|

Re: Installing packages into updated R

Henric Nilsson
In reply to this post by Mike Prager

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

______________________________________________
[hidden email] mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html