aggregate_sample: Produce Population Weighted Aggregated Samples

View source: R/aggregation.R

aggregate_sampleR Documentation

Produce Population Weighted Aggregated Samples

Description

Aggregate by area, year, age and type (weighted by population), and convert to a percentage/probability.

Usage

aggregate_sample(
  .data,
  aggr_cols = c("area_id", "area_name", "year", "age", "age_group", "model", "type"),
  num_cols,
  ages = 0:60,
  ...
)

Arguments

.data

data.frame including area populations, with un-aggregated samples.

aggr_cols

Columns to aggregate samples by, Default: c("area_id", "area_name", "year", "age", "age_group", "model", "type")

num_cols

numeric columns to aggregate.

...

Further arguments passed to data.table::rbindlist.

Value

data.frame with samples aggregated by aggr_cols and weighted by population.


mrc-ide/threemc documentation built on Feb. 9, 2024, 5:16 p.m.