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

2011-04-08 Thread algorimancer
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

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

2011-04-08 Thread Duncan Murdoch
On 08/04/2011 11:47 AM, algorimancer wrote: 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

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

2011-04-08 Thread William Dunlap
] On Behalf Of algorimancer Sent: Friday, April 08, 2011 8:47 AM To: r-help@r-project.org Subject: Re: [R] How to *completely* stop a script after stop()? 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

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

2011-04-08 Thread Duncan Murdoch
[mailto:r-help-boun...@r-project.org] On Behalf Of algorimancer Sent: Friday, April 08, 2011 8:47 AM To: r-help@r-project.org Subject: Re: [R] How to *completely* stop a script after stop()? I too am encountering this problem. When I have a large script, if I select all in the editor

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

2011-04-08 Thread Jonathan P Daily
we, what's the word... imbue it. - Jubal Early, Firefly r-help-boun...@r-project.org wrote on 04/08/2011 12:38:37 PM: [image removed] Re: [R] How to *completely* stop a script after stop()? Duncan Murdoch to: algorimancer 04/08/2011 12:40 PM Sent by: r-help-boun...@r

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

2011-04-08 Thread Duncan Murdoch
removed] Re: [R] How to *completely* stop a script after stop()? Duncan Murdoch to: algorimancer 04/08/2011 12:40 PM Sent by: r-help-boun...@r-project.org Cc: r-help On 08/04/2011 11:47 AM, algorimancer wrote: I too am encountering this problem. When I have

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

2011-04-08 Thread algorimancer
Thank you all for the astoundingly quick responses. I think that the bounding open/closed braces approach sounds like the easiest solution for the moment -- though I look forward to seeing this all automated in a future version of R :) Incidentally, I have indeed encapsulated much of the code as

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

2011-01-15 Thread Marius Hofert
Dear expeRts, is there a neat way to *completely* stop a script after an error occured? For example, consider the following script: ## file.R for(i in 1:10){ print(i) if(i == 5) stop(i == 5) } for(i in 11:100) print(i) ## stop() behaves like it

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

2011-01-15 Thread Taras Zakharko
I take you don't use source() to execute your scripts. When using source, stop() aborts the complete script, just as you indent to. -- View this message in context: http://r.789695.n4.nabble.com/How-to-completely-stop-a-script-after-stop-tp3218808p3218823.html Sent from the R help mailing list

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

2011-01-15 Thread Carl Witthoft
Somehow this reminds me of a famous FORTRAN code snippet: 10 STOP STOP STOP ! IN CASE STILL SKIDDING GOTO 10 quote From: Marius Hofert m_hofert_at_web.de Date: Sat, 15 Jan 2011 09:09:20 +0100 Dear expeRts, is there a neat way to *completely* stop a script after an error occured? For

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

2011-01-15 Thread Mike Marchywka
Date: Sat, 15 Jan 2011 11:29:20 -0500 From: c...@witthoft.com To: r-help@r-project.org Subject: [R] How to *completely* stop a script after stop()? Somehow this reminds me of a famous FORTRAN code snippet: 10 STOP STOP STOP ! IN CASE

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

2011-01-15 Thread Ista Zahn
Hi Carl, If you wrap the whole script in brackets the script will not proceed past the stop() function: { for(i in 1:10){ print(i) if(i == 5) stop(i == 5) } for(i in 11:100) print(i) } best, Ista On Sat, Jan 15, 2011 at 4:29 PM, Carl Witthoft c...@witthoft.com wrote: Somehow

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

2011-01-15 Thread Phil Spector
Marius - Do you get the behaviour you want if you substitute if(i == 5){cat('i==5\n');quit(save='n')} for the line with the call to stop? - Phil Spector Statistical Computing Facility

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

2011-01-15 Thread Uwe Ligges
On 15.01.2011 18:17, Ista Zahn wrote: Hi Carl, If you wrap the whole script in brackets the script will not proceed past the stop() function: { for(i in 1:10){ print(i) if(i == 5) stop(i == 5) } for(i in 11:100) print(i) } Yes, or write it inside a function (since I