summarise.dtplyr_step {dtplyr} | R Documentation |
Summarise each group to one row
Description
This is a method for the dplyr summarise()
generic. It is translated to
the j
argument of [.data.table
.
Usage
## S3 method for class 'dtplyr_step'
summarise(.data, ..., .by = NULL, .groups = NULL)
Arguments
.data |
A |
... |
< The value can be:
Returning values with size 0 or >1 was
deprecated as of 1.1.0. Please use |
.by |
< |
.groups |
Grouping structure of the result.
When
In addition, a message informs you of that choice, unless the result is ungrouped,
the option "dplyr.summarise.inform" is set to |
Examples
library(dplyr, warn.conflicts = FALSE)
dt <- lazy_dt(mtcars)
dt %>%
group_by(cyl) %>%
summarise(vs = mean(vs))
dt %>%
group_by(cyl) %>%
summarise(across(disp:wt, mean))