Skip to content

R in BATCH mode

2 messages · vito muggeo, Brian Ripley

#
Dear all,
In R<=1.6.2 I usually used the following code (in DOS prompt) to run R in
batch mode

C:\documents> Rcmd BATCH myfile.R

and I could see the results (including warning messages) in the file
myfile.Rout

In R.1.7.0 I'm experiencing the followings:

(1) even if I type "Rcmd BATCH myfile.R myfile.Rout",
no file myfile.Rout is created, but just a "&1" file
(2)After typing  "Rcmd BATCH myfile.R" the following message appears
immediately in DOS prompt
ARGUMENT '2' __ignored__
(3) results are printed in file "&1", but the process is rather slow.
Am I missing anything?

I'm running R-1.7.0 on WinME,

Many thanks,
best,
vito
#
On Tue, 20 May 2003, vito muggeo wrote:

            
Ah, so you really are at a DOS prompt.  R is designed to be run in
Windows, and this works in all versions of Windows available to me (XP and
2000, and WinME is obselete).  The problem is your so-called `shell',
command.com.

Solution 1 is to get a real shell (even a real OS).

Solution 2 is to edit the rw1070/bin/BATCH file and replace

system("Rterm.exe $R_opts < $infile > $outfile 2>&1");

by

system("Rterm.exe $R_opts < $infile > $outfile");

and realize that probably the warning and error messages will not get 
diverted to the file.

If anyone knows definitively how to do this in command.com, please let 
R-Windows at r-project.org now.