Description Usage Arguments Value Examples
Check that values are within a set of bounds
1 | check_between(..., .strict_lower = FALSE, .strict_upper = FALSE)
|
... |
named arguments where each name is a column, and each value is a length-2 numeric vector of the form c(lower_bound, upper_bound) |
.strict_lower |
should the lower bound be strict? |
.strict_upper |
should the upper bound be strict? |
a CheckResult object
1 2 3 4 5 6 7 8 9 | df <- data.frame(a = c(1, 2, 3, NA), b = c(4, 5, 6, 7))
cb1 <- check_between(a = c(1, 4), b = c(3, 7))
cb1(df) # passes
cb2 <- check_between(a = c(1, 4), b = c(3, 7), .strict_lower = TRUE)
cb2(df) # fails
cb3 <- check_between(a = c(1, 4), b = c(3, 7), .strict_upper = TRUE)
cb3(df) # fails
cb4 <- check_between(a = c(1, 4), b = c(3, 7), .strict_lower = TRUE, .strict_upper = TRUE)
cb4(df) # fails
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.