[Rd] help page of warnings()

Hadley Wickham h.wickham at gmail.com
Mon Dec 30 15:17:08 CET 2013

> Finally, for your specific use case, see also ?withCallingHandlers which
> can not only detect warnings, but also set callback functions which can
> decide whether to abort or process and restart when a warning is thrown.
> The documentation for that function is a little rough, though you can see
> it in action in Hadley Wickham's evaluate package (specifically
> evaluate/R/eval.r).

I've also written a little about it at

But I think the main problem is assuming that rm(list=ls()) "resets"
back to a clean state.  Apart from the last warning, there are many
other things that this command will not clean up. You're much better
off getting into the habit of restarting R. In Rstudio, this is
particularly convenient because there's a keyboard shortcut (cmd +
shift + F10).



More information about the R-devel mailing list