title: Running R in Batch Mode on Linux: Output Issues
body: <p>I'm running an R program on a linux cluster because it is very demanding on my processor.  My program is designed to output multiple (around 15) plots as PDF's into the folder from which the program gathers its input.  </p>
  
  <p>I want my program to run in the background, and to continue running when I log out of the cluster.  </p>
  
  <p>First, I tried this:</p>
  
  <pre><code>cd /Users/The/Folder/With/My/RScript #changed working directory
  nohup ./BatchProgram.R &amp;
  </code></pre>
  
  <p>However, this didn't work because it appended the output to a file called <code>nohup.out</code>, and did not output any of the PDF's I need.  </p>
  
  <p>Next I tried this:</p>
  
  <pre><code>cd /Users/The/Folder/With/My/RScript #changed working directory
  R #to run R
  source(‘BatchProgram.R’) #to run my program
  </code></pre>
  
  <p>This gave me the desired output, but didn't run the program in the background (and would stop when I logged out of the cluster).  </p>
  
  <p>Could someone enlighten me as to how I might obtain the output of my second block of code, while running the program in the background AND causing it to continue running even after I log off of the linux cluster (like the first block of code)?</p>
  
  <p>Many thanks!</p>