group_data: Grouping data

Description Usage Arguments Value See Also Examples

Description

Grouping data

Usage

1
2
3

Arguments

.data

a tibble

Value

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.

See Also

Other grouping functions: group_by_all, group_by, group_indices, group_size, groups

Examples

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()

olascodgreat/samife documentation built on May 13, 2019, 6:11 p.m.