Peek First Interval Overlapping a Query Interval
Source:R/60-interval_index-query-api.R
peek_overlaps.RdPeek First Interval Overlapping a Query Interval
Details
Returns the first match in canonical interval order. Use
peek_all_overlaps() to retrieve all matches as an interval_index slice.
Examples
ix <- interval_index("a", "b", "c", start = c(1, 3, 5), end = c(2, 4, 6))
peek_overlaps(ix, 2, 3)
#> NULL
# Boundary override at touching endpoints
edge <- interval_index("a", start = 1, end = 3, bounds = "[)")
peek_overlaps(edge, 3, 4) # default "[)": no endpoint overlap
#> NULL
peek_overlaps(edge, 3, 4, bounds = "[]") # closed bounds: endpoint overlaps
#> [1] "a"