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

algorimancer clanders at utmb.edu
Fri Apr 8 17:47:29 CEST 2011


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: http://r.789695.n4.nabble.com/How-to-completely-stop-a-script-after-stop-tp3218808p3436704.html
Sent from the R help mailing list archive at Nabble.com.



More information about the R-help mailing list