group_split | R Documentation |
Split data frame by groups. Returns a list.
group_split(.df, ..., .keep = TRUE, .named = FALSE)
.df |
A data.frame or data.table |
... |
Columns to group and split by. |
.keep |
Should the grouping columns be kept |
.named |
experimental: Should the list be named with labels that identify the group |
df <- tidytable(
a = 1:3,
b = 1:3,
c = c("a", "a", "b"),
d = c("a", "a", "b")
)
df %>%
group_split(c, d)
df %>%
group_split(c, d, .keep = FALSE)
df %>%
group_split(c, d, .named = TRUE)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.