pop_within: Pop First Interval Within a Query Interval

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

pop_withinR Documentation

Pop First Interval Within a Query Interval

Description

Pop First Interval Within a Query Interval

Usage

pop_within(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

Removes the first match in canonical interval order. On miss, returns a non-throwing miss object with remaining = x. Use pop_all_within() to remove all matches.

Value

A list with element, start, end, and remaining. On miss: element, start, and end are NULL.

Examples

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

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