[R] R CMD BATCH --vanilla --slave produces unwanted lines

David Brahm brahm at alum.mit.edu
Fri May 30 18:44:55 CEST 2003


Robin Hankin <r.hankin at auckland.ac.nz> wrote:

> Anyway, now I'm trying to run R in batch mode, but I'm getting extra
> output, which I don't want (RedHat 8.3, R-1.7.0):
...
> r:~% R CMD BATCH --vanilla --slave test.R

Why not just run:
unix> R --vanilla --slave < test.R > test.out

Then the "options(echo=FALSE)" line is unnecessary.  Note an explicit q()
at the end of the script eliminates a single blank line that occurs otherwise.
So the test.R script is just:

  write(rnorm(4),"")
  q()

-- 
                              -- David Brahm (brahm at alum.mit.edu)




More information about the R-help mailing list