summarise.duckplyr_df {duckplyr} | R Documentation |
Summarise each group down to one row
Description
This is a method for the dplyr::summarise()
generic.
See "Fallbacks" section for differences in implementation.
summarise()
creates a new data frame.
It returns one row for each combination of grouping variables;
if there are no grouping variables,
the output will have a single row summarising all observations in the input.
It will contain one column for each grouping variable
and one column for each of the summary statistics that you have specified.
Usage
## S3 method for class 'duckplyr_df'
summarise(.data, ..., .by = NULL, .groups = NULL)
Arguments
.data |
A data frame, data frame extension (e.g. a tibble), or a lazy data frame (e.g. from dbplyr or dtplyr). See Methods, below, for more details. |
... |
< The value can be:
|
.by |
< |
.groups |
When
In addition, a message informs you of that choice, unless the result is ungrouped,
the option "dplyr.summarise.inform" is set to |
Fallbacks
There is no DuckDB translation in summarise.duckplyr_df()
with
.groups = "rowwise"
.
These features fall back to dplyr::summarise()
, see vignette("fallback")
for details.
See Also
Examples
library(duckplyr)
summarise(mtcars, mean = mean(disp), n = n())