[R] controlling where *.Rout gets printed. Possible?

Uwe Ligges ligges at statistik.uni-dortmund.de
Thu Sep 1 19:12:34 CEST 2005


Paul Johnson wrote:

> OK, my journey to make lab machines automagically install & update all 
> desirable R packages is nearing an end!  The only question I have now is 
> this: How can I control where the system prints the *.Rout file that is 
> created automatically when the R batch program runs.  In "man R" I don't 
> find any information about it.  When the cron job runs "R_installAll.sh" 
> (see below), I'd like to re-direct it to someplace that ordinary users 
> can read.

But you find help in
   R CMD BATCH --help
which tells you:
   "Usage: R CMD BATCH [options] infile [outfile]"

Hence simply call R by something like
   R CMD BATCH /usr/local/bin/R_installAll.R /path/to/R_installAll.Result


Uwe Ligges


> Here's the shell script I will schedule with cron
> 
> ------------R_installAll.sh ----------
> #!/bin/bash
> R CMD BATCH /usr/local/bin/R_installAll.R
> --------------------------------------
> 
> And here's the R program
> 
> -------------R_installAll.R-------------
> 
> # Paul Johnson <pauljohn _AT_ ku.edu> 2005-08-31
> # This should update and then install all packages, except for
> # ones I exclude because they don't work or we don't want them.
> 
> 
> options(repos = "http://lib.stat.cmu.edu/R/CRAN/")
> 
> update.packages(ask=F)
> theNew <- new.packages()
> failPackages <- 
> c("BRugs","GDD","gtkDevice","gap","gnomeGUI","mimR","ncdf","pathmix","rcdd","rgdal","rpvm",
> "Rmpi","RQuantLib","RMySQL", 
> "RNetCDF","RODBC","ROracle","RScaLAPACK","rsprng","RWinEdt","taskPR")
> 
> shouldFail <- theNew %in% failPackages
> 
> install.packages( theNew[!shouldFail],dependencies=T)
> 
> 
> # VGAM is not in CRAN yet, but Zelig wants it.
> # install.packages("VGAM", CRAN="http://www.stat.auckland.ac.nz/~yee");
> 
> 
> update.packages(CRAN="http://www.stat.auckland.ac.nz/~yee")
> --------------------------------------
> 
> 
> 
>




More information about the R-help mailing list