I am trying to debug a function. I would like to display warnings when they occur but I don't understand how to change the warning settings.
It may be useful to specify
options(warn=2, error=recover)
As mentioned by @plannapus, warn=2
will upgrade warnings to errors; error=recover
will drop you into a debug/browser mode at the point where the warning (now upgraded to an error) occurred. (Use options(warn=0, error=NULL)
to restore the original settings.)