[R] how to run .r batch file

Ko-Kang Kevin Wang Ko-Kang at xtra.co.nz
Thu Mar 28 22:58:09 CET 2002


----- Original Message -----
From: <lj22 at u.washington.edu>
To: <r-help at stat.math.ethz.ch>
Sent: Friday, March 29, 2002 9:02 AM
Subject: [R] how to run .r batch file

> I am completely new to R, but have some bg in cs and stat.
> since R has an interactive programming environment, I thought I could
write my command in a file and run it in batch mode in the Rgui. but it
didnt work. I checked the doc. it said Rcmd BATCH inputfile. it didnt work

1) It does work.

2) How did you do it?  You need to run:
        Rcmd BATCH source.R
    (where source.R is your input file) in DOS-prompt, or CygWin.  But you
must make sure the $R_HOME\bin directory is under your PATH.

3) When you say it didn't work, what are the error message

> also if you can shed some light on passing command line arguements (like
mybatchfile arg1 arg2), I would appreciate it!!

Not sure what you mean here.

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