I have a following data frame
data <- tibble(ID=rep(c(1:2), each= 9), time = rep(1:9, 2), event = c(1,1,1,0,0,0,0,1,1,1,1,0,0,0,1,0,1,0))
I want to retrieve the first row for each subject which has "1" after the consecutive zeros i.e.row number 8 in the data.frame for first subject and row number 15 in the data.frame for the second subject