Learn R Programming

tidytidbits (version 0.2.3)

add_summary_by: Add summary to tibble

Description

A verb for a dplyr pipeline: Groups the frame by ... in addition to the current grouping, then calls add_summary, then returns the frame with the mutated summarising columns in the same grouping state as it was before this function was called.

Usage

add_summary_by(.data, .language, ...)

Arguments

.data

Data argument, typical "first" argument in dplyr verbs

.language

A call to summarise(), or another method performing equivalent aggregation (potentially wrapping summarise())

...

Parameters for group_by

Value

The tibble with added columns