data(efc)
# non-grouped
table(efc$neg_c_7)
# split into 3 groups
table(split_var(efc$neg_c_7, 3))
# original
table(efc$e42dep)
# two groups, non-inclusive cut-point
# vector split leads to unequal group sizes
table(split_var(efc$e42dep, 2))
# two groups, inclusive cut-point
# group sizes are equal
table(split_var(efc$e42dep, 2, inclusive = TRUE))
Run the code above in your browser using DataLab