groups {dplyr} | R Documentation

## Return grouping variables

### Description

`group_vars()` returns a character vector; `groups()` returns a list of symbols.

### Usage

    groups(x)

    group_vars(x)

### Arguments

`x` | A `tbl()`

### See Also

`group_cols()` for matching grouping variables in selection contexts.

Other grouping functions: `group_by_all`, `group_by`, `group_indices`, `group_keys`, `group_map`, `group_nest`, `group_rows`, `group_size`, `group_trim`

### Examples

    df <- tibble(x = 1, y = 2) %>% group_by(x, y)
    group_vars(df)
    groups(df)

[Package dplyr version 0.8.0.1 Index]