[R] Advice about system for installing & updating all R package in a Linux Lab?

Jonathan Baron baron at psych.upenn.edu
Sat Aug 20 04:48:14 CEST 2005


On 08/19/05 16:23, Paul Johnson wrote:
> Good day:
> 
> I'm administering 6 linux systems (FC4) in a student lab and worry that
> users may want packages that are not installed.  I get tired of adding
> them one by one.  Then I happened upon this page
> 
> http://support.stat.ucla.edu/view.php?supportid=30
> 
> about installing all R packages from CRAN.  That did not run as it was,
> but after some fiddling I arrived at the following script, which does
> run and it builds many packages and reports failures on the rest:
> 
> #R_installAll.R
> options(repos = "http://lib.stat.cmu.edu/R/CRAN/")
> update.packages(ask=F)
> x <- packageStatus(repositories="http://cran.r-project.org/src/contrib")
> st <- x$avai["Status"]
> install.packages(rownames(st)[which(st$Status=="not installed")],
> dependencies=T)

I used to do this:

    update.packages()
    cp <- CRAN.packages()[,1]
    ip <- installed.packages()[,1,]
    install.packages(setdiff(cp,ip))

But now it looks like you can do this:

    install.packages(new.packages())

Jon
-- 
Jonathan Baron, Professor of Psychology, University of Pennsylvania
Home page: http://www.sas.upenn.edu/~baron




More information about the R-help mailing list