Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- DF$Consistent <- apply(DF, 1, function(x) as.numeric(sum(abs(diff(x))) <= 1))
- DF <- as.data.frame(rbind(c(0,0,0,1,1), c(1,1,0,0,0), c(1,1,1,1,1), c(0,0,0,0,0), c(1,0,1,0,0), c(0,0,0,1,0)))
Add Comment
Please, Sign In to add comment