View source: R/60-interval_index-query-api.R
| peek_all_point | R Documentation |
Peek All Intervals Matching a Point
peek_all_point(
x,
point,
bounds = NULL,
match_at = c("interval", "start", "end", "either"),
as_list = FALSE
)
x |
An |
point |
Query point. |
bounds |
Optional boundary override. One of |
match_at |
How the query point is matched against each entry. One of
|
as_list |
If |
With as_list = FALSE, the returned interval_index can be inspected with
as.list().
When as_list = FALSE (default): an interval_index slice of all
matches (possibly empty). When as_list = TRUE: a named list with
values (list of payloads), starts, and ends. For numeric /
integer endpoint domains, starts and ends are atomic vectors; for
class-bearing endpoint domains (e.g. Date, POSIXct) they are
returned as lists to preserve the endpoint class.
ix <- interval_index("a", "b", "c", start = c(1, 2, 4), end = c(3, 2, 5))
as.list(peek_all_point(ix, 2))
# Entries ending at 3
as.list(peek_all_point(ix, 3, match_at = "end"))
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.