interval_index: Construct an Interval Index

View source: R/60-interval_index-constructors.R

interval_indexR Documentation

Construct an Interval Index

Description

Convenience constructor from ..., start, and end.

Usage

interval_index(..., start, end, default_query_bounds = "[)")

Arguments

...

Elements to add.

start

Start endpoints matching ....

end

End endpoints matching ....

default_query_bounds

Boundary convention used as the default for query operations on this index: one of "[)", "[]", "()", "(]". Per-query ⁠peek_*⁠ / ⁠pop_*⁠ calls may override via their own bounds argument.

Details

Empty construction is supported: interval_index() returns an empty index.

Output is ordered by interval start.

Value

An interval_index.

Examples

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

interval_index()

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