Learn R Programming

uniqtag (version 1.0.1)

cumcount: Cumulative count of strings.

Description

Return an integer vector counting the number of occurrences of each string up to that position in the vector.

Usage

cumcount(xs)

Arguments

xs

a character vector

Value

an integer vector of the cumulative string counts

Examples

Run this code
# NOT RUN {
cumcount(abbreviate(state.name, 3, strict = TRUE))
# }

Run the code above in your browser using DataLab