Hello to everybody! I want to run R in batch mode but it doen't work (Error: syntax error) I've found this in R help: R CMD BATCH [options] infile [outfile] I have tried differents commands: (I have been working in the same directory I have "test.txt" file and "test2.txt" would be the output file) > R CMD BATCH "test.txt" or > R CMD BATCH test.txt or > BATCH test.txt or > R CMD BATCH test.txt test2.txt or > R CMD BATCH "test.txt" "test2.txt" or > R CMD BATCH --no-save <"test.txt"> I don't know what is wrong. Could you help me, please? Thanks a lot
On Fri, 18 Nov 2005, Beatriz wrote:> I want to run R in batch mode but it doen't work (Error: syntax error) > > I've found this in R help: > R CMD BATCH [options] infile [outfile] > > I have tried differents commands: > (I have been working in the same directory I have "test.txt" file and > "test2.txt" would be the output file) > > > R CMD BATCH test.txt > > [SNIP additional tries] > > I don't know what is wrong. Could you help me, please?Isn't it possible that it is working just fine and you really do have a syntax error in your R source file (better named as 'test.R') instead? ---------------------------------------------------------- SIGSIG -- signature too long (core dumped)
On 11/18/2005 10:20 AM, Beatriz wrote:> Hello to everybody! > > I want to run R in batch mode but it doen't work (Error: syntax error) > > I've found this in R help: > R CMD BATCH [options] infile [outfile] > > I have tried differents commands: > (I have been working in the same directory I have "test.txt" file and > "test2.txt" would be the output file) > > > R CMD BATCH "test.txt"Where did you type that? It looks like you typed it within R. That's a shell command, and needs to be typed in a shell. However, I can't be sure about this, because you're not showing us what happened when you tried it. Please, please, please: if you need help with an error, show us the exact error message and tell us the context where you received it. Duncan Murdoch
On 11/18/2005 11:25 AM, Beatriz wrote:> I write > R CMD BATCH test.R > in my R console > > I have send you an image (RunBatch.jpg) of my console and the "test.R" fileI don't think the jpg made it to R-help, but I saw it. You tried to run R CMD BATCH test.R from within R. That's meant to be a system command. Since you're running in Windows, you should open a command shell. One way to do that is to choose "Run..." from the Start Menu, and enter "cmd". You'll get a black command shell window. If your path is set properly so that you can run R from there, then R CMD BATCH test.R should work. There is a way to do this from within R: run > system("R CMD BATCH test.R",intern=TRUE) This still depends on your path being set correctly to find R. Duncan Murdoch