Force stop or halt on error

hatmatrix picture hatmatrix · Sep 15, 2009 · Viewed 9k times · Source

I was wondering if anyone knew of a good way to get R or ESS to stop executing the rest of the code beyond the point at which an error occurs if I am evaluating a region or buffer (I've only found the opposite request in the help archives). I was looking in the R help files but option(error=stop) will only stop execution of the offending function or statement but not those that follow it. Thanks!

Answer

Yannick Wurm picture Yannick Wurm · Nov 16, 2009

If R/ESS is hogging up so much compute time that your emacs/ESS is unresponsive to C-c C-c, you can also save it by sending an INTERRUPT signal from the terminal.

First: figure out R's processID using top or ps. (mine was 98490 Then: kill -2 98490 That sends an interrupt signal and you get your ESS/Emacs and R session back