title: R CMD BATCH output
body: <p>is there a way to give the same name of the R script to the pdf produced using R CMD BATCH such as for the .Rout file?</p>
  
  <p>This is the default:</p>
  
  <pre><code>:~$ R CMD BATCH my_script.R
  :~$ ls
  my_script.R
  my_script.Rout
  Rplots.pdf
  </code></pre>
  
  <p>So to change Rplots.pdf into my_scripts.pdf </p>
  
  <p><strong>EDIT</strong>
   The code for my_script.R</p>
  
  <pre><code>x &lt;- c(1:5); y &lt;- x # create some data
  par(pch=22, col="red") # plotting symbol and color
  par(mfrow=c(2,4)) # all plots on one page
  opts = c("p","l","o","b","c","s","S","h")
  for(i in 1:length(opts)){
    heading = paste("type=",opts[i])
    plot(x, y, type="n", main=heading)
    lines(x, y, type=opts[i])
  }
  </code></pre>