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

distinct_se(.data, groupingVars, .keep_all = FALSE)

Arguments

.data

data.frame

groupingVars

character vector of column names to group by.

.keep_all

logical, passed to dplyr::distinct.

Value

.data passed through distinct with groupingVars args.

See also

Examples

datasets::mtcars %.>% distinct_se(., c("cyl", "gear"))
#> cyl gear #> Mazda RX4 6 4 #> Datsun 710 4 4 #> Hornet 4 Drive 6 3 #> Hornet Sportabout 8 3 #> Toyota Corona 4 3 #> Porsche 914-2 4 5 #> Ford Pantera L 8 5 #> Ferrari Dino 6 5