df <- data.table(
a = 1:5,
b = 6:10,
c = c(rep("a", 3), rep("b", 2)),
d = c(rep("a", 3), rep("b", 2))
)
df %>%
nest_by.()
df %>%
nest_by.(c, d)
df %>%
nest_by.(where(is.character))
df %>%
nest_by.(c, d, .keep = TRUE)
Run the code above in your browser using DataLab