For a vector with repeated values return a vector where each element is the count how often the element was observed previously

as_replicate(x)

Arguments

x

a vector with repeated elements

Value

numeric vector

See also

Examples

x <- c("a", "b", "a", "b", "b", "d") all(proDA:::as_replicate(x) == c(1,1,2,2,3,1))
#> [1] TRUE