krlmlr / condition

Missing parts of base R's wonderful condition system

Home Page:http://krlmlr.github.io/condition

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

condition wercker status codecov.io

R doesn’t come with a built-in constructor function for conditions, but we can easily add one.

(Advanced R, by Hadley Wickham)

Actually, there is simpleCondition(), simpleError() and the like, but they don't allow specifying an additional class. The functions in this package allow it:

library(condition)
cond <- new_error("Something went wrong", class = "oops")
cond
## <oops: Something went wrong>
is.error(cond)
## [1] TRUE

See the vignette for additional details.

About

Missing parts of base R's wonderful condition system

http://krlmlr.github.io/condition


Languages

Language:R 54.7%Language:Makefile 31.3%Language:Shell 14.0%