Group a data frame by the groupingVars and add group labels.

group_indices_se(.data, groupingVars, add = FALSE)

Arguments

.data

data.frame

groupingVars

character vector of column names to group by.

add

logical, passed to group_by

Value

per-row group index assignments

See also

Examples

group_indices_se(datasets::mtcars, c("cyl", "gear"))
#> Warning: The `...` argument of `group_keys()` is deprecated as of dplyr 1.0.0. #> Please `group_by()` first
#> [1] 5 5 2 4 7 4 7 2 2 5 5 7 7 7 7 7 7 2 2 2 1 7 7 7 7 2 3 3 8 6 8 2