[R-sig-Debian] updating r-cran- packages on a new Ubuntu lucid system

Dirk Eddelbuettel edd at debian.org
Mon Jan 31 18:14:04 CET 2011


On 31 January 2011 at 09:04, Michael Friendly wrote:
| I'm not any further ahead in trying to update vcd from 1.2-7 to 1.2-9. 
| How can I resolve this?

If what you're doing doesn't work, do something else.   The .deb package are
convenient.  They can't all be recent because, well, a distro has release
schedules.

Below is install.r, a cousin of the script upgrade.r I posted earlier and
also included in littler. I use it to install into 

     /usr/local/lib/R/site-library

which (by coming first in the default list of directories) is the default
directory anyway.  So To install packages foo, bar and bling at once just do

	 $ ~/bin/install.r foo bar bling 

Hth,  Dirk


#!/usr/bin/env r
#
# a simple example to install one or more packages

if (is.null(argv) | length(argv)<1) {

  cat("Usage: installr.r pkg1 [pkg2 pkg3 ...]\n")
  q()

}

## adjust as necessary, see help('download.packages')
#repos <- "http://cran.us.r-project.org"
repos <- "http://cran.r-project.org"

## this makes sense on Debian where no packages touch /usr/local
lib.loc <- "/usr/local/lib/R/site-library"

#args(install.packages)
#function (pkgs, lib, repos = getOption("repos"),
#          contriburl = contrib.url(repos, type),
#          method, available = NULL, destdir = NULL,
#          installWithVers = FALSE,
#          dependencies = FALSE, type = getOption("pkgType"),
#          configure.args = character(0),
#          clean = FALSE)
install.packages(argv, lib.loc, repos)


-- 
Dirk Eddelbuettel | edd at debian.org | http://dirk.eddelbuettel.com



More information about the R-SIG-Debian mailing list