super_split | R Documentation |
This function is a streamlined, recursive version of
split()
.
super_split(.data, ...)
.data |
a dataframe |
... |
(unquoted) names of columns to split by |
a list of dataframes when splitting by a single variable, a list of lists of dataframes when splitting by 2 variables, and so on.
# some kind of 2 by 2 design
df <- data.frame(
x = c(1, 2, 3, 4, 5, 6, 7, 8),
time = c(1, 1, 2, 2, 1, 1, 2, 2),
group = c("a", "a", "a", "a", "b", "b", "b", "b")
)
super_split(df, group)
super_split(df, time)
# split by group and then split each of those by time
super_split(df, group, time)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.