title: Passing command line arguments to R CMD BATCH
body: <p>I have been using <code>R CMD BATCH my_script.R</code> from a terminal to execute an <code>R</code> script.  I am now at the point where I would like to pass an argument to the command, but am having some issues getting it working.  If I do <code>R CMD BATCH my_script.R blabla</code> then <code>blabla</code> becomes the output file, rather than being interpreted as an argument available to the R script being executed.</p>
  
  <p>I have tried <code>Rscript my_script.R blabla</code> which seems to pass on <code>blabla</code> correctly as an argument, but then I don't get the <code>my_script.Rout</code> output file that I get with <code>R CMD BATCH</code> (I want the <code>.Rout</code> file).  While I could redirect the output of a call to <code>Rscript</code> to a file name of my choosing, I would not be getting the R input commands included in the file in the way <code>R CMD BATCH</code> does in the <code>.Rout</code> file.  </p>
  
  <p>So, ideally, I'm after a way to pass arguments to an R script being executed via the <code>R CMD BATCH</code> method, though would be happy with an approach using <code>Rscript</code> if there is a way to make it produce a comparable <code>.Rout</code> file.</p>