For `which = "first"`, removes and returns the first (leftmost) sequence element among entries whose key equals `key`.
Usage
pop_key(x, key, which = c("first", "all"))Value
A named list with components element, key, and
remaining.
For
which = "first":On match:
elementis the first matching item andkeyis its key.On miss:
element = NULL,key = NULL,remaining = x.
For
which = "all":elementis anordered_sequenceof all matching items in stable order. It may have size 0 (miss), 1 (single match), or greater than 1 (multiple matches).keyis the normalized key on match, otherwiseNULL.remainingis the original sequence with that full key-run removed (or unchanged on miss).