Description Usage Arguments Value See Also Examples
Checks to see if the inputs are (in)finite.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 | assert_all_are_finite(x, severity = getOption("assertive.severity", "stop"))
assert_any_are_finite(x, severity = getOption("assertive.severity", "stop"))
assert_all_are_infinite(x, severity = getOption("assertive.severity", "stop"))
assert_any_are_infinite(x, severity = getOption("assertive.severity", "stop"))
assert_all_are_negative_infinity(x, severity = getOption("assertive.severity",
"stop"))
assert_any_are_negative_infinity(x, severity = getOption("assertive.severity",
"stop"))
assert_all_are_positive_infinity(x, severity = getOption("assertive.severity",
"stop"))
assert_any_are_positive_infinity(x, severity = getOption("assertive.severity",
"stop"))
is_finite(x, .xname = get_name_in_parent(x))
is_infinite(x, .xname = get_name_in_parent(x))
is_negative_infinity(x, .xname = get_name_in_parent(x))
is_positive_infinity(x, .xname = get_name_in_parent(x))
|
x |
Input to check. |
severity |
How severe should the consequences of the assertion be?
Either |
.xname |
Not intended to be used directly. |
is_finite
wraps is.finite
, showing the
names of the inputs in the answer. is_infinite
works
likewise for is.infinite
. The assert_*
functions
return nothing but throw an error if the corresponding
is_*
function returns FALSE
.
1 2 3 4 5 6 7 8 9 | x <- c(0, Inf, -Inf, NA, NaN)
is_finite(x)
is_infinite(x)
is_positive_infinity(x)
is_negative_infinity(x)
assert_all_are_finite(1:10)
assert_any_are_finite(c(1, Inf))
assert_all_are_infinite(c(Inf, -Inf))
assertive.base::dont_stop(assert_all_are_finite(c(0, Inf, -Inf, NA, NaN)))
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.