R/consecutive_id.R
consecutive_id..Rd
Generate a unique id for runs of consecutive values
consecutive_id.(...)
Vectors of values
x <- c(1, 1, 2, 2, 1, 1) consecutive_id(x) #> [1] 1 1 2 2 3 3