Description Usage Arguments Value See Also Examples
Grouping data
1 2 3 |
.data |
a tibble |
group_data()
return a tibble with one row per group. The last column, always called .rows
is a list of integer vectors indicating the rows for each group.
If .data
is a grouped data frame the first columns are the grouping variables.
group_rows()
just returns the list of indices.
Other grouping functions: group_by_all
,
group_by
, group_indices
,
group_size
, groups
1 2 3 4 5 6 7 8 9 | df <- tibble(x = c(1,1,2,2))
# one row
group_data(df)
group_rows(df)
# 2 rows, one for each group
group_by(df,x) %>% group_data()
group_by(df,x) %>% group_rows()
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.