From h.wickham at gmail.com  Mon Dec 30 15:17:08 2013
From: h.wickham at gmail.com (Hadley Wickham)
Date: Mon, 30 Dec 2013 08:17:08 -0600
Subject: [Rd] help page of warnings()
In-Reply-To: <CADwqtCN3x95-oGgzgzj77QDjsh6pRDhuTfiYUT1DMMXSQqZ4og@mail.gmail.com>
References: <CA+aKpMd+eUty3BM+eirvBQ3CB8hr_PBKZ5eq-Yehz-TQEgnHEw@mail.gmail.com>
	<CAE3=dmfvHOw1jais_OO5DW--Z8fkA7rm=SCrBn=jwmFwONMy3g@mail.gmail.com>
	<CA+aKpMfukGXVj9_QUwvh+LZg3-6_jJT76s_Go=9OUKo20YDnWQ@mail.gmail.com>
	<CAE3=dmcrLm+_nhm5T_8RAm4VZfmFGKfupBm9ZkQ99xmYiW7thw@mail.gmail.com>
	<CA+aKpMcPi0CHou3uGytWigT0YuFGKJj2Zxy4pibyVOgohi+XBQ@mail.gmail.com>
	<CADwqtCN3x95-oGgzgzj77QDjsh6pRDhuTfiYUT1DMMXSQqZ4og@mail.gmail.com>
Message-ID: <CABdHhvG2OhFEKUu7oEvNgV0mFhffBZz-pic+Um8ULr9SzNVKqQ@mail.gmail.com>

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



[Rd] help page of warnings()
Hadley Wickham