peek_containing: Peek First Interval Containing a Query Interval

View source: R/60-interval_index-query-api.R

peek_containingR Documentation

Peek First Interval Containing a Query Interval

Description

Peek First Interval Containing a Query Interval

Usage

peek_containing(x, start, end, bounds = NULL)

Arguments

x

An interval_index.

start

Query interval start.

end

Query interval end.

bounds

Optional boundary override. One of "[)", "[]", "()", "(]".

Details

Returns the first match in canonical interval order. Use peek_all_containing() to retrieve all matches as an interval_index slice.

Value

The payload value from the first match, or NULL on no match.

Examples

ix <- interval_index("a", "b", "c", start = c(1, 2, 4), end = c(5, 3, 6))
peek_containing(ix, 2, 3)

Immutables documentation built on April 29, 2026, 1:06 a.m.