Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- id <- c(rep(1,4),rep(2,3),rep(3,4))
- missing <- c(rep(0,4),1,0,1,rep(0,4))
- wave <- c(seq(1:4),1,2,3,seq(1:4))
- df <- as.data.frame(cbind(id,missing,wave))
- df
- df <- df %>% group_by(id) %>% filter(missing==0, wave==1, wave==2, wave==3, wave==4)
- df
Add Comment
Please, Sign In to add comment