[R] How to stop execution

From: Fernando Saldanha <fsaldan1_at_gmail.com>
Date: Sun 15 Oct 2006 - 17:19:35 GMT

I frequently run R code using source() or just paste large chunks of code into the console window. When there is an error in the code the execution does not stop. Rather, there is a blue error message and the remainder of the code continues to execute.


  1. Is there a way to change the color of the error messages from blue to another color? There are other messages (not error messages) that are also blue and to have another color would make it easier to spot errors as the screen scrolls through the code.
  2. Is there a way to make execution of the sourced or pasted code to stop immediatelyt if there is an error? I did some research and found a way to make the whole session end, but that is too radical. I also tried to change the option error from NULL to stop and that also does not do the trick: the remaining pasted or sourced code is still executed.

Any help will be appreciated. I am running R version 2.3.0 on Windows XP Pro.


R-help@stat.math.ethz.ch mailing list
https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code. Received on Mon Oct 16 03:23:55 2006

Archive maintained by Robert King, hosted by the discipline of statistics at the University of Newcastle, Australia.
Archive generated by hypermail 2.1.8, at Sun 15 Oct 2006 - 18:30:10 GMT.

Mailing list information is available at https://stat.ethz.ch/mailman/listinfo/r-help. Please read the posting guide before posting to the list.