View source: R/add_group_indices.R
add_group_indices | R Documentation |
Group a data frame and add per-group indices as a column.
add_group_indices(.data, groupingVars, indexColumn)
.data |
data.frame |
groupingVars |
character vector of column names to group by. |
indexColumn |
character name of column to add indices to. |
.data with group identifying column added.
add_group_indices(datasets::mtcars, c("cyl", "gear"), 'groupID')
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.