I'd like to make a separate grouping variable for each duplicate like so. Does anyone have any suggestions on how to do this?
without_group<-data.frame(V1= c(1,2,3,1,2,3))
with_group<-
data.frame(
V1= c("A","A","A","B","B","B"),
V2= c(1,2,3,1,2,3)
)