DataSHIELD implentation of dplyr::group_by.

groupByDS(tidy_expr, df.name, .add, .drop)

Arguments

tidy_expr

Diffused grouping expression.

df.name

A data frame, data frame extension (e.g. a tibble), or a lazy data frame (e.g. from dbplyr or dtplyr).

.add

When FALSE, the default, group_by() will override existing groups. To add to the existing groups, use .add = TRUE.

.drop

Drop groups formed by factor levels that don't appear in the data? The default is TRUE except when df.name has been previously grouped with .drop = FALSE.

Value

A grouped data frame with class grouped_df, unless the combination of tidy_expr

and .add yields a empty set of grouping columns, in which case a tibble will be returned.