Roger D. Peng wrote:
> You might be interested in 'tryCatch' to catch warnings.
A warning here: tryCatch(expr, warning=...) will catch warnings and
interrupt 'expr' (as if an error occured), whereas
withCallingHandlers(expr, warning=...) does not do this.
/Henrik
> -roger
>
> Thomas Friedrich
Thomas Friedrichsmeier wrote:
> Yes, thanks for pointing it out. However, I'm actually looking for a way to
> catch all warnings in a whole (interactive) session. Can warning.expression
> be used for that?
I've just been nosing around the source code in errors.c, and it
doesn't look good.
I
> I'm afraid this does not make sense to me. An "interactive session" is
> not some monolithic blob. It is a sequence of one or more (often very
> many) discreet interactions. Any one of these may produce an
> exceptional condition, and it seems to me that each individual
> interaction that eli
Thomas,
On Thursday 22 September 2005 10:00, Thomas Friedrichsmeier wrote:
> > You might be interested in 'tryCatch' to catch warnings.
>
> Yes, thanks for pointing it out. However, I'm actually looking for a
> way to catch all warnings in a whole (interactive) session. Can
> warning.expression be
> You might be interested in 'tryCatch' to catch warnings.
Yes, thanks for pointing it out. However, I'm actually looking for a way to
catch all warnings in a whole (interactive) session. Can warning.expression
be used for that?
Thomas
__
R-help@stat
> ?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
You might be interested in 'tryCatch' to catch warnings.
-roger
Thomas Friedrichsmeier wrote:
> Hi!
>
> I'm trying to catch all warning-messages for special handling. It seems
> options (warning.expression=myfunc ()) can be used for that. However, the
> question is: How can I get at the actual
n is to catalyze the scientific learning
process." - George E. P. Box
> -Original Message-
> From: [EMAIL PROTECTED]
> [mailto:[EMAIL PROTECTED] On Behalf Of Thomas
> Friedrichsmeier
> Sent: Thursday, September 22, 2005 9:14 AM
> To: r-help@stat.math.ethz.ch
> Subj
Hi!
I'm trying to catch all warning-messages for special handling. It seems
options (warning.expression=myfunc ()) can be used for that. However, the
question is: How can I get at the actual warning in myfunc ()? Apparently in
S, you can use .C("get_last_message") for that. Is there a similar m