fgroup_by {timeplyr}R Documentation

'collapse' version of dplyr::group_by()

Description

This works the exact same as dplyr::group_by() and typically performs around the same speed but uses slightly less memory.

Usage

fgroup_by(
  data,
  ...,
  .add = FALSE,
  order = TRUE,
  .by = NULL,
  .cols = NULL,
  .drop = TRUE
)

Arguments

data

data frame.

...

Variables to group by.

.add

Should groups be added to existing groups? Default is FALSE.

order

Should groups be ordered? If FALSE groups will be ordered based on first-appearance.

.by

(Optional). A selection of columns to group by for this operation. Columns are specified using tidyselect.

.cols

(Optional) alternative to ... that accepts a named character vector or numeric vector. If speed is an expensive resource, it is recommended to use this.

.drop

Should unused factor levels be dropped? Default is TRUE.

Details

fgroup_by() works almost exactly like the 'dplyr' equivalent. An attribute "sorted" (TRUE or FALSE) is added to the group data to signify if the groups are sorted or not.

Value

A grouped_df.


[Package timeplyr version 0.5.0 Index]