[R] warning.expression?

Thomas Friedrichsmeier thomas.friedrichsmeier at ruhr-uni-bochum.de
Thu Sep 22 18:57:48 CEST 2005


> ?warnings

No, sorry, this does not work. Try this, if you like:

myfunc <- function () {
	warnings ()
}
options (warning.expression=quote (myfunc ()))
warning ("test")

> Also see ?conditions

tryCatch ()
and
withCallingHandlers ()

are a whole different story, as far as I understand them. I actually want 
_all_ warnings in the whole session to go through my handler (actually I'm 
writing a GUI front-end, and would like to have a way to easily identify all 
warnings).

That's what I thought warning.expression was designed for. So am I wrong in 
thinking so? If not, how to use it correctly?

> Note that both were suggested by help.search('warning') -- Please do make
> full use of R's internal documentation before posting.

It's quite possible, I'm overlooking something rather obvious. Not that 
obvious, however.

Regards
Thomas




More information about the R-help mailing list