# NOT RUN {
x1 <- c(3, 4, 2, 2, 1, 1, 1, 3)
group_eq(x1)
group_if(x1, `<=`)
group_if(x1, function(x, y) abs(x - y) > 1)
x2 <- c(3, 4, 2, -2, -1, 1, 1, 3)
group_if(x2, `==` %on% abs)
x3 <- list(1:3, 1:3, 3:5, 1, 2)
group_if(x3, `==` %on% length)
# }
Run the code above in your browser using DataLab