crplyr (version 0.3.8)

summarize: 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 CrunchDataset
summarise(.data, ...)

Arguments

.data

A CrunchDataset

...

named aggregations to include in the resulting table.

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().

Details

Note that while mutate() is not generally supported in crplyr, you can derive expressions on the fly in summarize().

Examples

Run this code
# NOT RUN {
ds %>%
    filter(cyl == 6) %>%
    group_by(vs) %>%
    summarize(hp=mean(hp), sd_hp=sd(hp), count=n())
# }

Run the code above in your browser using DataLab