Skip to content
Back to formatted view

Raw Message

Message-ID: <200509221857.48332.thomas.friedrichsmeier@ruhr-uni-bochum.de>
Date: 2005-09-22T16:57:48Z
From: Thomas Friedrichsmeier
Subject: warning.expression?
In-Reply-To: <200509221635.j8MGZTK2026080@meitner.gene.com>

> ?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