Description Usage Arguments Value Examples
The argument names here are meant to follow purrr::detect.
1 2 3 4 5 | find_value2(.x, .y, .p, ..., .dir = c("forward", "backward"), .default = NULL)
find_value(.x, .p, ..., .dir = c("forward", "backward"), .default = NULL)
find_position(.x, .p, ..., .dir = c("forward", "backward"), .default = NULL)
|
.x, .y |
Vectors to iterate over. For 2-argument version, |
.p |
A predicate function for determining matches. |
... |
Additional arguments to set for the predicate |
.dir |
Direction to traverse the items. One of |
.default |
Value used when no match is found. |
either the .default
value or the values of the first match.
1 2 3 | find_value2(1:10, -4:5, function(x, y) x + y > 10)
find_value2(1:10, -4:5, function(x, y) x + y > 11)
find_value2(1:10, -4:5, function(x, y) x + y > 100)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.