[R] passing command line arguments to 'R CMD BATCH myScript.R'

Brahm, David David.Brahm at geodecapital.com
Fri Feb 25 18:09:29 CET 2005


I have never understood the difference between 
> R CMD BATCH --vanilla --slave myScript.R outFile.txt
and
> R --vanilla --slave < myScript.R > outFile.txt

I use the latter method, and then the --args construction works great:
> R --vanilla --slave --args myArg1 myArg2 < myScript.R > outFile.txt

In fact, I define "R --vanilla --slave --args" to be an environment
variable $R, and then it's just
> $R myArg1 myArg2 < myScript.R > outFile.txt

-- David Brahm (brahm at alum.mit.edu)




More information about the R-help mailing list