sum_to: A convenience function for summation using quoted variable...

Description Usage Arguments Value Examples

Description

A convenience function for summation using quoted variable names

Usage

1
sum_to(data_frame, group_by)

Arguments

data_frame

The data frame

group_by

The variables you want to keep as breakouts in the aggregated data, as a character vector of variable names. This should include any variable you plan to use on an X-axis (e.g. Fiscal.Year).

y_vars

The variables you want to aggregate, as a character vector of variable names. By default, all numeric or integer variables that are not listed in the group_by argument. Variables that are not listed in either group_by or y_vars will be rolled up in the aggregation and absent from the returned data frame.

Value

An aggregated data frame

Examples

1
2
3
4
5
6
## Not run: 
shown %<>% sum_to(
  group_by = c(input$breakout_variable, input$facet_variable, "Fiscal.Year"),
  y_vars = input$y_variable)

## End(Not run)

CSISdefense/hamre documentation built on May 31, 2019, 7:58 a.m.