Error catching can be hard to catch at times (no pun intended). If you’re not used to error handling, this short post might help you do it elegantly.
There are many posts about error handling in R (and in fact the examples in the
purrrpackage documentation are not bad either). In this sense, this post is not original.
However, I do demonstrate two approaches: both the base-R approach (
tryCatch) and the
possibly). The post contains a concise summary of the two methods, with a very simple example.
Read the whole thing. H/T R-Bloggers