Skip to content
Prev 14124 / 398502 Next

Yet another batch mode question

On Tue, 9 Oct 2001, Prof Brian D Ripley wrote:

            
I did forget the "--no-save" or "--vanilla" or "--save" option that is
required for #2 but otherwise:

[mfenner at seneca testForList]$ cat test.R
x <- array(trunc(3*runif(100)), c(10,10))
mean(x)

[mfenner at seneca testForList]$cat results
Script started on Tue Oct  9 09:41:52 2001

[mfenner at seneca testForList]$ R --no-save < test.R
R : Copyright 2001, The R Development Core Team
Version 1.3.1  (2001-08-31)

<snip>
[1] 0.94
[mfenner at seneca testForList]$ R CMD BATCH test.R
[mfenner at seneca testForList]$ more test.Rout

R : Copyright 2001, The R Development Core Team
Version 1.3.1  (2001-08-31)
 
<snip>
[1] 0.8
[1] 1.35 0.09 1.47 0.00 0.00
[mfenner at seneca testForList]$ exit
Script done on Tue Oct  9 09:42:43 2001
[mfenner at seneca testForList]$

In short, they both work for me.  You can supress the echoing of commands
by placing a options(echo = FALSE) type line in your script file.
So, do people not use R in this fashion under Unix (as a general
rule)?  That is, running R from the command line with a script and an
input file.

BTW, I am primarily interested in the Unix environment.  Scripting under
Windows raises my blood pressure :) (unless it is in cygwin).

Regards,
Mark

-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-
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
_._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._