| summarize {crplyr} | R Documentation |
Aggregate a Crunch dataset
Description
This is an alternate interface to crunch::crtabs() that, in addition to
being "tidy", makes it easier to query multiple measures at the same time.
Usage
## S3 method for class 'CrunchDataset'
summarise(.data, ...)
Arguments
.data |
A |
... |
named aggregations to include in the resulting table. |
Details
Note that while mutate() is not generally supported in crplyr, you can
derive expressions on the fly in summarize().
Value
A tbl_crunch_cube or cr_tibble of results. This subclass
of tibble allows ggplot2::autoplot to work, but can get in the way
in some tidyverse operations. You may wish to convert to a tibble using
as_tibble().
Examples
## Not run:
ds %>%
filter(cyl == 6) %>%
group_by(vs) %>%
summarize(hp=mean(hp), sd_hp=sd(hp), count=n())
## End(Not run)
[Package crplyr version 0.4.0 Index]