title: Aborting execution of code in R(-Studio)
body: <p>I'm using RStudio for writing code in R. Usually I submit larger chunks of code by selecting it and pressing <code>Ctrl + Enter</code>. Now, When an error occurs (e.g. connection to a databse could not be established), I'd like to abort execution of the subsequent code.</p>
  
  <p>I tried <code>stop()</code>, which works when all the code is in one line:</p>
  
  <pre><code># 21 is not shown
  42; stop("error"); 21;
  </code></pre>
  
  <p>But when the code spans multiple lines, the code is still evaluated:</p>
  
  <pre><code># Here 21 is shown
  42
  stop("error")
  21
  </code></pre>
  
  <p>Is the a way to abort execution of code when submitting larger chunks of code?</p>