Indicate grouping variables in data frame

group_by_data(.data, ...)

Arguments

.data

Data frame

...

Unquoted (non-standard evaluation) name(s) of group variable(s).

Value

A data frame with groups attribute

Examples

d <- data.frame(a = c("a", "b", "c"), b = 1:3, stringsAsFactors = FALSE) group_by_data(d, a)
#> # A tibble: 3 x 2 #> a b #> <chr> <int> #> 1 a 1 #> 2 b 2 #> 3 c 3