Learn R Programming

tidytable (version 0.10.2)

consecutive_id.: Generate a unique id for consecutive values

Description

Generate a unique id for runs of consecutive values

Usage

consecutive_id.(...)

Arguments

...

Vectors of values

Examples

Run this code
x <- c(1, 1, 2, 2, 1, 1)
consecutive_id(x)

Run the code above in your browser using DataLab