aggregate_data_and_draws: Aggregate data and draws

Description Usage Arguments

Description

Aggregate the draws (rates) and the data (population and deaths) by a set of grouping identifiers

Usage

1
2
3
4
5
6
7
8
aggregate_data_and_draws(
  in_data,
  num_field,
  denom_field,
  draw_fields,
  group_fields = NULL,
  summarize = TRUE
)

Arguments

in_data

Input data.table, including draws (in rate space), the numerator and denominator (in count space), and any grouping fields

num_field

Field containing the data numerator (e.g. deaths)

denom_field

Field containing the data denominator (e.g. population)

draw_fields

Character vector of fields containing predictive draws, in rate space (e.g. mortality rates)

group_fields

[optional, default NULL] Character vector containing all fields for grouping observations during the aggregation. If this field is empty, all data will be aggregated to a single row and returned with no identifiers

summarize

[bool, default TRUE] should summary columns be added for the aggregated draws?


njhenry/covidemr documentation built on Feb. 2, 2022, 2:31 a.m.