Description Usage Arguments Examples
Checks either whether both extrema are in the given range, or if each individual value is.
1 |
x |
any atomic or vector-like object |
lower |
lower range |
upper |
upper range |
inc |
logical vector of length one or two; should the lower and upper ranges, respectively, be considered inclusive? |
na |
should |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 | in_range(c(1:3, NA), 1, 4, na=NA)
in_range(1:4, 1, 4)
in_range(matrix(1:4, 2), 1, 4)
in_range(1:4, 1, 4, inc=1:0)
in_range(1:4, 1, 4, inc=0:1)
in_range(1:4, 1, 4, inc=0)
x <- as.Date(0:3, origin="2000-01-01")
in_range(x, "2000-01-01", "2000-01-04")
in_range(letters[1:4], "a", "d", inc=1:0)
in_range(letters[1:4], "a", "da", inc=1:0)
# no upper range
in_range(c(10^rnorm(9), NA), 0, NA)
in_range(c(10^rnorm(9), NA), 0, NA, na=TRUE)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.