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!
Stop code execution. As you run your code, it may stop executing for one of the following reasons: An untrapped run-time error occurs. A trapped run-time error occurs, and Break on All Errors is selected on the General tab of the Options dialog box. A breakpoint is encountered.
Once an app has been force-stopped, the action cannot be reversed. The app stays closed until you manually launch it again. And that's basically the only way to undo a force stop—reopening the app.
You halt execution manually at a given point. A watch expression that you set to break if its value changes or becomes true is encountered. To switch to break mode, from the Run menu, choose Break (CTRL+BREAK), or use the toolbar shortcut: . To switch to design time, from the Run menu, choose Reset <projectname>, or use the toolbar shortcut: .
As you run your code, it may stop executing for one of the following reasons: An untrapped run-time error occurs. A trapped run-time error occurs, and Break on All Errors is selected on the General tab of the Options dialog box. A breakpoint is encountered. A Stop statement in your code is encountered, switching the mode to break mode.
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
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With