pop_point: Pop First Interval Matching a Point

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

pop_pointR Documentation

Pop First Interval Matching a Point

Description

Pop First Interval Matching a Point

Usage

pop_point(
  x,
  point,
  bounds = NULL,
  match_at = c("interval", "start", "end", "either")
)

Arguments

x

An interval_index.

point

Query point.

bounds

Optional boundary override. One of "[)", "[]", "()", "(]". Ignored when match_at is not "interval".

match_at

How the query point is matched against each entry. One of "interval" (default; containment under bounds), "start", "end", or "either". See peek_point() for details.

Details

Removes the first match in canonical interval order. On miss, returns a non-throwing miss object with remaining = x. Use pop_all_point() 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(3, 2, 5))
pop_point(ix, 2)

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