ordered_sequence: Construct an Ordered Sequence

View source: R/50-ordered_sequence-constructors.R

ordered_sequenceR Documentation

Construct an Ordered Sequence

Description

Convenience constructor from ... and matching keys.

Usage

ordered_sequence(..., keys)

Arguments

...

Elements to add.

keys

Key values with the same length as ....

Details

Empty construction is supported: ordered_sequence() returns an empty ordered sequence.

Output is always sorted by key, with stable order across duplicate keys.

Value

An ordered_sequence.

Examples

xs <- ordered_sequence("bb", "a", "ccc", keys = c(2, 1, 3))
xs
lower_bound(xs, 2)

num_by_chr <- ordered_sequence(20, 10, 30, keys = c("b", "a", "c"))
num_by_chr

ordered_sequence()

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