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 either. Can someone help? thank you. thank you. also if you can shed some light on passing command line arguements (like mybatchfile arg1 arg2), I would appreciate it!! Lei Department of Chemsitry University of Washington Box 351700 Seattle, WA 98195 Phone: 206-543-4153 Fax: 206-685-8665 -.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.- 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 _._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._
Hi, ----- 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 couldwrite 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 either. 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 (likemybatchfile 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 _._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._
----- Original Message ----- From: <lj22 at u.washington.edu> To: "Ko-Kang Kevin Wang" <Ko-Kang at xtra.co.nz> Sent: Friday, March 29, 2002 12:08 PM Subject: Re: [R] how to run .r batch file> > That is the problem. You can't run it under RGui. You should do it in > > command line mode, i.e. in DOS prompt under Windows (Start -> Run... ->cmd)> Well, I did try that. but it didnt work. It said > 'Rcmd' is not recognized as an internal or external command > operable program or batch file. > > I did set up the path. I can run Rterm from anywhere in DOS. if you gointo the R\bin\ directory. there's no executable for "Rcmd". it's not surprising that it wont run under dos.> > so what's the problem here.How did you install R? Which version of R are you running? I do not know why Rcmd is not in the R\bin directory, you might want to consider resintalling (the latest version) R. By the way it is a good idea to cc your follow-up questions to r-help. There is a chance that someone else had encountered the same problem before and can tell you straight away what is wrong. Cheers, Ko-Kang -.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.- 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 _._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._
You don't get Rcmd installed unless you check the "Source package installation files" option when running SetupR. The "Introduction to R" manual explains the 3 ways to run R in Windows. Rgui is the windowed version, Rterm is the command line version, and Rcmd is a wrapper that calls Rterm. I'd suggest that you just use Rterm: Rterm --vanilla <myfile.R >myfile.out will do what you want. Duncan Murdoch -.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.- 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 _._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._