Re: [R] How to *completely* stop a script after stop()?

From: algorimancer <>
Date: Fri, 08 Apr 2011 08:47:29 -0700 (PDT)

I too am encountering this problem. When I have a large script, if I select all in the editor and then ctrl-r to run, if it encounters a stop() function it simply prints an error message and continues to execute the remainder of the script, as opposed to terminating execution at that line. The quit() function exits R altogether, which I don't want. Yes, I could manually select only the portion of script which I want to run, but for lengthy scripts which I run repeatedly (generally changing only the name of the file I want analyzed), this can be quite tedious. It appears that the only solution is to put most of the code in a separate file and call it using source(); this has the downside of reducing the clarity of the code -- it's a sort-of structural spaghetti code approach.

View this message in context:
Sent from the R help mailing list archive at

______________________________________________ mailing list
PLEASE do read the posting guide
and provide commented, minimal, self-contained, reproducible code.
Received on Fri 08 Apr 2011 - 16:31:07 GMT

Archive maintained by Robert King, hosted by the discipline of statistics at the University of Newcastle, Australia.
Archive generated by hypermail 2.2.0, at Fri 08 Apr 2011 - 16:50:28 GMT.

Mailing list information is available at Please read the posting guide before posting to the list.

list of date sections of archive