title: Running R Scripts with Plots
body: <p>I have a small shell script (bash) which runs a R script which produces a plot as output. Everything works fine but immedietly after the plot is rendered R quits. Is there a way to keep the R session alive until the plot window is closed.</p>
  
  <p>The shell script.</p>
  
  <pre><code>#!/bin/bash
  R --slave --vanilla &lt; myscript.r
  </code></pre>
  
  <p>And the R script.</p>
  
  <pre><code>daq = read.table(file('mydata.dat'))
  X11()
  pairs(daq)
  //R Completes this and then exits immediately.
  </code></pre>
  
  <p>Thanks in advance for any help!</p>