I know using match() will extract the first occurrence of a variable, but how can I create a new column labeling the first occurrence?
for example how could I get:
example <- data.frame(id = c(1,1,1,2,3,4), label = c(1,0,0,1,1,1))
thanks in advance!