Reputation: 78917
I have a dataset with 2 columns:
library(tidyverse)
col1 <- c("a", "b", "c", "d", "a", "b","c", "e", "f", "a", "b", "m", "l", "a", "z", "i")
col2 <- c(1:16)
df <- tibble(col1, col2)
How can I group col1 with id: starting each time when a is occurring in the row of col1.
Desired output:
Upvotes: 1
Views: 109