[prev in list] [next in list] [prev in thread] [next in thread] 

List:       r-devel
Subject:    Re: [Rd] help page of warnings()
From:       Hadley Wickham <h.wickham () gmail ! com>
Date:       2013-12-30 14:17:08
Message-ID: CABdHhvG2OhFEKUu7oEvNgV0mFhffBZz-pic+Um8ULr9SzNVKqQ () mail ! gmail ! com
[Download RAW message or body]

> 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
http://adv-r.had.co.nz/Exceptions-Debugging.html#condition-handling.

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).

Hadley

-- 
http://had.co.nz/

______________________________________________
R-devel@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-devel
[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic