title: R equivalent to MATLAB's "stop if error"
body: <p>I'm attempting to debug an R program, and I'm sorely missing the <code>stop if error</code> capability of matlab. I've gone through the <a href="http://www.biostat.jhsph.edu/~rpeng/docs/R-debug-tools.pdf" rel="noreferrer">R-debug-tools.pdf</a>  (<a href="https://web.archive.org/web/20170803163042/http://www.biostat.jhsph.edu/~rpeng/docs/R-debug-tools.pdf" rel="noreferrer">mirror</a>) documentation, but it didn't list anything like this. Is there any way to instruct R that, when any error at all is encountered - even one I didn't anticipate and plan for with a custom <code>trace</code> function - it should stop execution and throw me into <a href="https://stat.ethz.ch/R-manual/R-devel/library/base/html/browser.html" rel="noreferrer"><code>browser()</code></a> mode?</p>