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 Sept. 5, 2021, 5:12 p.m.