| assert_all_are_finite {assertive.numbers} | R Documentation |
Checks to see if the inputs are (in)finite.
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.
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)))