Description Usage Arguments Details Author(s) Examples
Tests if x
is between lower
and upper
.
By default, the limits are not included.
1 | is_between(x, lower, upper, include_limits = FALSE, allow_na = TRUE)
|
x |
Number(s) to test. (Numeric) |
lower |
Lower limit. (Numeric) |
upper |
Upper limit. (Numeric) |
include_limits |
Whether to include limits in
the allowed values for |
allow_na |
Whether to allow |
When include_limits is FALSE:
x > lower & x < upper
When include_limits is TRUE:
x >= lower & x <= upper
Ludvig Renbo Olsen, r-pkgs@ludvigolsen.dk
1 2 3 4 5 6 7 8 9 | # Attach packages
library(rtilities2)
is_between(3, 1, 5) # TRUE
is_between(-1, 1, 5) # FALSE
is_between(1, 1, 5) # FALSE
is_between(1, 1, 5, include_limits = TRUE) # TRUE
is_between(5, 1, 5) # FALSE
is_between(5, 1, 5, include_limits = TRUE) # TRUE
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.