count_key: Count Elements Matching One Key

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

count_keyR Documentation

Count Elements Matching One Key

Description

Count Elements Matching One Key

Usage

count_key(x, key)

Arguments

x

An ordered_sequence.

key

Query key.

Details

Counts multiplicity for a single key. Returns 0L when the key is not present.

Value

Integer count of matches.

Examples

x <- ordered_sequence("a", "b", "c", keys = c(1, 2, 2))
count_key(x, 2)
count_key(x, 10)

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