h_in_range | R Documentation |
A simple helper function that tests whether elements of a given vector or matrix are within specified interval.
h_in_range(x, range = c(0, 1), bounds_closed = TRUE)
x |
( |
range |
( |
bounds_closed |
( |
A logical vector or matrix of length equal to the length of x
, that
for every element of x
, indicates whether a given element of x
is in
the range
.
x <- 1:4
h_in_range(x, range = c(1, 3))
h_in_range(x, range = c(1, 3), bounds_closed = FALSE)
h_in_range(x, range = c(1, 3), bounds_closed = c(FALSE, TRUE))
mat <- matrix(c(2, 5, 3, 10, 4, 9, 1, 8, 7), nrow = 3)
h_in_range(mat, range = c(1, 5))
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.