Generate a unique id for each group
group_indices(.data, ...)
.data | a tbl |
---|---|
... | Variables to group by. All tbls accept variable names. Some tbls will accept functions of variables. Duplicated groups will be silently dropped. |
Other grouping functions: group_by_all
,
group_by
, group_keys
,
group_map
, group_nest
,
group_rows
, group_size
,
group_trim
, groups
group_indices(mtcars, cyl)#> [1] 2 2 1 2 3 2 3 1 1 2 2 3 3 3 3 3 3 1 1 1 1 3 3 3 3 1 1 1 3 2 3 1