collapse the data based on factors and group level strata
collapse_data.Rdcollapse the data based on factors and group level strata
Arguments
- data
a data.table of exposures or outcomes
- column_mapping
a named list mapping column roles to column names in
data- fcn
function used to aggregate the exposure or outcome column, e.g.
sumormean- data_type
either
'exposure'or'outcome'; selects which column is aggregated- grp_level
logical; if
TRUE, aggregate togeo_unit_grp- keep_unit
logical; if
TRUE, keep unit-level rows whengrp_levelisTRUE