title: How to only display the first two plots of `plot(model)` in script mode?
body: <p>I have a script that essentially boils down to</p>
  
  <pre><code>model &lt;- lm(d$o ~ d$t * d$w)
  plot(model)
  </code></pre>
  
  <p>When I run these commands in interactive mode (RStudio), <code>plot</code> will create four graphs. The user has to advance to the next graph by pressing enter.</p>
  
  <p>Now, I want to run the commands in (almost) non-interactive mode and the <code>plot</code> command to display only the first two graphs. The user of the script of course should still be required to mouse click or press enter <em>after</em> the R environment has displayed the first and second graph.</p>
  
  <p>How could I achieve this?</p>
  
  <h2>Edit</h2>
  
  <p>It has been suggested that I use the <code>which</code> parameter (being described in <code>?plot.lm</code>). Yet, if I change the respective line to</p>
  
  <pre><code>plot(model, which=1)
  </code></pre>
  
  <p>the script aborts with</p>
  
  <pre><code>Error in box(...) : invalid 'which' argument
  Calls: plot -&gt; plot.default -&gt; localBox -&gt; box
  In addition: Warning messages:
  1: In plot.window(...) : "which" is not a graphical parameter
  2: In plot.xy(xy, type, ...) : "which" is not a graphical parameter
  3: In axis(side = side, at = at, labels = labels, ...) :
    "which" is not a graphical parameter
  4: In axis(side = side, at = at, labels = labels, ...) :
    "which" is not a graphical parameter
  Execution halted
  </code></pre>