assertthat
assertthat copied to clipboard
User friendly assertions for R
you -> your
The `rlang` package makes it possible to add classes to the error conditions (e.g. `rlang::abort`). This is a convenient feature for later working with the error messages. There are for...
Hi, the test for scalar evaluates also complex data types to true. For example ``` assertthat::is.scalar(list("foo")) [1] TRUE ``` This was quite unexpected to me, because it is also documented...
``` assert_that(inherits(NULL, c("a", "b"))) Error in stop(assertError(attr(res, "msg"))) : bad error message ``` The issue is here, where `what` is assumed length-1: https://github.com/hadley/assertthat/blob/50dc4b0a8a8c91d1ef47366a8f534065c32530ba/R/base-is.r#L45-L49
I like assert_that(), wonderful function. Luckily I live in a world where all my code now successfully clears all the assert_that()s we have in there. That means I get a...
When calling nested functions, the error is reported in the outer function `outer_f()`, while it happens in the inner function `inner_f()`. In complex cases this is very difficult to debug....
Fixes #70 It's not a problem with lazy evaluation or promises, it's caused by the incorrect propagation of `msg`. If one of the assertions is already coming from `assert_that` then...
**Feature proposal**: Adding a warning feature to the `assertthat` package. **See also**: https://github.com/hadley/assertthat/issues/37 **Naming ideas**: - `recommend_that()` Rationale: If the recommendation is not followed, then a warning is given. -...
The company I work at are trying to open source some R code, but we're running into the situation that GPLv2 is incompatible with GPLv3, making it impossible for us...