assert_all_are_in_closed_range(x, lower = -Inf, upper = Inf, na_ignore = FALSE, severity = getOption("assertive.severity", "stop"))
assert_any_are_in_closed_range(x, lower = -Inf, upper = Inf, na_ignore = FALSE, severity = getOption("assertive.severity", "stop"))
assert_all_are_in_left_open_range(x, lower = -Inf, upper = Inf, na_ignore = FALSE, severity = getOption("assertive.severity", "stop"))
assert_any_are_in_left_open_range(x, lower = -Inf, upper = Inf, na_ignore = FALSE, severity = getOption("assertive.severity", "stop"))
assert_all_are_in_open_range(x, lower = -Inf, upper = Inf, na_ignore = FALSE, severity = getOption("assertive.severity", "stop"))
assert_any_are_in_open_range(x, lower = -Inf, upper = Inf, na_ignore = FALSE, severity = getOption("assertive.severity", "stop"))
assert_all_are_in_range(x, lower = -Inf, upper = Inf, lower_is_strict = FALSE, upper_is_strict = FALSE, na_ignore = FALSE, severity = getOption("assertive.severity", "stop"))
assert_any_are_in_range(x, lower = -Inf, upper = Inf, lower_is_strict = FALSE, upper_is_strict = FALSE, na_ignore = FALSE, severity = getOption("assertive.severity", "stop"))
assert_all_are_in_right_open_range(x, lower = -Inf, upper = Inf, na_ignore = FALSE, severity = getOption("assertive.severity", "stop"))
assert_any_are_in_right_open_range(x, lower = -Inf, upper = Inf, na_ignore = FALSE, severity = getOption("assertive.severity", "stop"))
assert_all_are_negative(x, na_ignore = FALSE, severity = getOption("assertive.severity", "stop"))
assert_any_are_negative(x, na_ignore = FALSE, severity = getOption("assertive.severity", "stop"))
assert_all_are_non_negative(x, na_ignore = FALSE, severity = getOption("assertive.severity", "stop"))
assert_any_are_non_negative(x, na_ignore = FALSE, severity = getOption("assertive.severity", "stop"))
assert_all_are_non_positive(x, na_ignore = FALSE, severity = getOption("assertive.severity", "stop"))
assert_any_are_non_positive(x, na_ignore = FALSE, severity = getOption("assertive.severity", "stop"))
assert_all_are_percentages(x, lower_is_strict = FALSE, upper_is_strict = FALSE, na_ignore = FALSE, severity = getOption("assertive.severity", "stop"))
assert_any_are_percentages(x, lower_is_strict = FALSE, upper_is_strict = FALSE, na_ignore = FALSE, severity = getOption("assertive.severity", "stop"))
assert_all_are_positive(x, na_ignore = FALSE, severity = getOption("assertive.severity", "stop"))
assert_any_are_positive(x, na_ignore = FALSE, severity = getOption("assertive.severity", "stop"))
assert_all_are_proportions(x, lower_is_strict = FALSE, upper_is_strict = FALSE, na_ignore = FALSE, severity = getOption("assertive.severity", "stop"))
assert_any_are_proportions(x, lower_is_strict = FALSE, upper_is_strict = FALSE, na_ignore = FALSE, severity = getOption("assertive.severity", "stop"))
is_in_closed_range(x, lower = -Inf, upper = Inf, .xname = get_name_in_parent(x))
is_in_left_open_range(x, lower = -Inf, upper = Inf, .xname = get_name_in_parent(x))
is_in_open_range(x, lower = -Inf, upper = Inf, .xname = get_name_in_parent(x))
is_in_range(x, lower = -Inf, upper = Inf, lower_is_strict = FALSE, upper_is_strict = FALSE, .xname = get_name_in_parent(x))
is_in_right_open_range(x, lower = -Inf, upper = Inf, .xname = get_name_in_parent(x))
is_negative(x, .xname = get_name_in_parent(x))
is_non_negative(x, .xname = get_name_in_parent(x))
is_non_positive(x, .xname = get_name_in_parent(x))
is_percentage(x, lower_is_strict = FALSE, upper_is_strict = FALSE, .xname = get_name_in_parent(x))
is_positive(x, .xname = get_name_in_parent(x))
is_proportion(x, lower_is_strict = FALSE, upper_is_strict = FALSE, .xname = get_name_in_parent(x))
FALSE
, NA
values
cause an error; otherwise they do not. Like na.rm
in many
stats package functions, except that the position of the failing
values does not change."stop"
, "warning"
, "message"
, or "none"
.TRUE
, the lower bound is open (strict)
otherwise it is closed.TRUE
, the upper bound is open (strict)
otherwise it is closed.is_*
functions return TRUE
if the input is
within an interval. The assert_*
functions return nothing but
throw an error if the corresponding is_*
function returns
FALSE
.
assert_all_are_positive(1:10)
assert_all_are_non_negative(0:10)
assert_any_are_positive(c(-1, 1))
assert_all_are_percentages(c(0, 50, 100))
assert_all_are_proportions(c(0, 0.5, 1))
assert_all_are_in_left_open_range(1 + .Machine$double.eps, lower = 1)
Run the code above in your browser using DataLab