add_group_indices: Group a data frame and add per-group indices as a column.

Description Usage Arguments Value Examples

View source: R/add_group_indices.R

Description

Group a data frame and add per-group indices as a column.

Usage

1
add_group_indices(.data, groupingVars, indexColumn)

Arguments

.data

data.frame

groupingVars

character vector of column names to group by.

indexColumn

character name of column to add indices to.

Value

.data with group identifying column added.

Examples

1
add_group_indices(datasets::mtcars, c("cyl", "gear"), 'groupID')

seplyr documentation built on June 12, 2021, 5:07 p.m.