Renaud,

The script below has been in use for about as long as littler existed, and
also ships with it. I use it, and its sibbling 'update.r' all the time. Doing
this at the command-line frees the R prompt during compilations too...

As Barry suggests, the RStudio-provided CDN is not a bad choice either as a
repo. 

Dirk

edd@max:~$ cat bin/install.r 
#!/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"

install.packages(argv, lib.loc, repos)
edd@max:~$ 

-- 
Dirk Eddelbuettel | e...@debian.org | http://dirk.eddelbuettel.com

______________________________________________
R-devel@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-devel

Reply via email to