Learn R Programming

dplyr (version 0.5.0)

groups: Get/set the grouping variables for tbl.

Description

These functions do not perform non-standard evaluation, and so are useful when programming against tbl objects. ungroup is a convenient inline way of removing existing grouping.

Usage

groups(x)

ungroup(x, ...)

Arguments

x

data tbl

...

Additional arguments that maybe used by methods.

Examples

Run this code
grouped <- group_by(mtcars, cyl)
groups(grouped)
groups(ungroup(grouped))

Run the code above in your browser using DataLab