| reframe.dtplyr_step {dtplyr} | R Documentation |
Summarise each group to one row
Description
This is a method for the dplyr dplyr::reframe() generic. It is translated to
the j argument of [.data.table.
Usage
## S3 method for class 'dtplyr_step'
reframe(.data, ..., .by = NULL)
Arguments
.data |
A |
... |
Name-value pairs of functions. The name will be the name of the variable in the result. The value can be a vector of any length. Unnamed data frame values add multiple columns from a single expression. |
.by |
< |
Examples
library(dplyr, warn.conflicts = FALSE)
dt <- lazy_dt(mtcars)
dt %>%
reframe(qs = quantile(disp, c(0.25, 0.75)),
prob = c(0.25, 0.75),
.by = cyl)
dt %>%
group_by(cyl) %>%
reframe(qs = quantile(disp, c(0.25, 0.75)),
prob = c(0.25, 0.75))
[Package dtplyr version 1.3.2 Index]