group_rows {dplyr} | R Documentation

## Grouping data

### Description

Grouping data

### Usage

    group_rows(.data)

    group_data(.data)

### 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_keys`, `group_map`, `group_nest`, `group_size`, `group_trim`, `groups`

### Examples

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

[Package dplyr version 0.8.0.1 Index]