[R] BATCH processing in R

Thomas Lumley thomas at biostat.washington.edu
Wed Sep 1 20:29:37 CEST 1999


On Wed, 1 Sep 1999, Laura Drake wrote:

> Dear List,
> 
> My question is whether it is possible (and if so, how) to enter values
> into R vectors (R_OUTFILE, and R_INFILE in my example below) from the
> command line.  In particular, I would like to run R, as a BATCH job,
> from a shell script, such as the following:

yes. Use getenv()

wompom% setenv R_INFILE foobar
R is a collaborative project with many contributors.
Type    "?contributors" for a list.

Type    "demo()" for some demos, "help()" for on-line help, or
        "help.start()" for a HTML browser interface to help.
Type    "q()" to quit R.

> getenv("R_INFILE")
R_INFILE 
"foobar" 
> sink(getenv("R_INFILE"))

etc at least under Unix (which I presume is where you are if you want to
use a shell script)


Thomas Lumley
Assistant Professor, Biostatistics
University of Washington, Seattle


-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-
r-help mailing list -- Read http://www.ci.tuwien.ac.at/~hornik/R/R-FAQ.html
Send "info", "help", or "[un]subscribe"
(in the "body", not the subject !)  To: r-help-request at stat.math.ethz.ch
_._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._



More information about the R-help mailing list