[R] Detect the Warning Message
jholtman at gmail.com
Fri Nov 5 13:26:32 CET 2010
and then you will find the following:
sets the handling of warning messages. If warn is negative all
warnings are ignored. If warn is zero (the default) warnings are
stored until the top–level function returns. If fewer than 10 warnings
were signalled they will be printed otherwise a message saying how
many (max 50) were signalled. An object called last.warning is created
and can be printed through the function warnings. If warn is one,
warnings are printed as they occur. If warn is two or larger all
warnings are turned into errors.
options(warn = 2)
will cause the system to halt at that point. Also setting:
will drop you in the 'browser' (?browser) so you can see the values of
objects when the error occurred.
Google for 'debugging R' to get some more information.
On Fri, Nov 5, 2010 at 4:00 AM, Yen Lee <b88207001 at ntu.edu.tw> wrote:
> Dear all,
> I've written a function and repeated it for 5000 times with loops with
> different value, and the messages returned are the output I set and 15
> I would like to trace the warnings by stopping the loop when warning came
> Does anyone know how to make it?
> Thanks a lot for your help.
> [[alternative HTML version deleted]]
> R-help at r-project.org mailing list
> PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
> and provide commented, minimal, self-contained, reproducible code.
+1 513 646 9390
What is the problem that you are trying to solve?
More information about the R-help