Validates that all elements of a value fall within a specified range. The
value can be numeric, Date, POSIXct, difftime or an ordered factor.
Usage
require_between(
restriction,
lower = -Inf,
upper = Inf,
exclusive_lower = FALSE,
exclusive_upper = FALSE
)Details
The value and the bounds must be the same kind: a Date bound
against a numeric value fails with a type error. Ordered-factor bounds are
single values of a factor with the same levels as the validated value.
Other input fails with a type error. NA elements are skipped; chain
require_no_na() to reject them.