From h.wickham at gmail.com  Tue Aug 29 16:46:14 2006
From: h.wickham at gmail.com (hadley wickham)
Date: Tue, 29 Aug 2006 09:46:14 -0500
Subject: [Rd] Capturing warnings with capture.output
Message-ID: <f8e6ff050608290746x420b56e7i5c7d7fabea9a9c98@mail.gmail.com>

Is there any way to include warnings in the output from capture.output?  eg:

a <- capture.output(warning("test"))
all.equal(a, "Warning message: \n test ")

Conceptually, this seems like redirecting stderr to stdout, or somehow
changing warning to simple print it's output.  I've had a look at
tryCatch and using a warning handler, but this terminates execution at
the warning.

Thanks,

Hadley




[Rd] Capturing warnings with capture.output
hadley wickham