ezReplicateNumber: Count how often a value has been seen before

View source: R/util.R

ezReplicateNumberR Documentation

Count how often a value has been seen before

Description

This can be used to get replicate identifiers. For each value unique value in the input it counts incrementally how often it occurs

Usage

ezReplicateNumber(x)

Arguments

x

a vector with discrete values

Value

Returns a vector of the same length as the input. If the value at an element is n, then this means, in the original value was the nth occurrence.

Examples

x = c("a", "c", "a", "b", "c")
ezReplicateNumber(x)

uzh/ezRun documentation built on March 5, 2025, 3:41 p.m.