powered by
Return an integer vector counting the number of occurrences of each string up to that position in the vector.
cumcount(xs)
a character vector
an integer vector of the cumulative string counts
# NOT RUN { cumcount(abbreviate(state.name, 3, strict = TRUE)) # }
Run the code above in your browser using DataLab