View source: R/postprocess-matrix.R
| per_capita | R Documentation |
Divides each column of the contact matrix by the population of the corresponding age group, giving the contact rate of age group i with one individual of age group j.
per_capita(x, survey_pop, ...)
x |
a list as returned by |
survey_pop |
a data frame with columns |
... |
passed to |
x with $matrix replaced by the per-capita version
data(polymod)
pop <- wpp_age("United Kingdom", 2005)
polymod |>
(\(s) s[country == "United Kingdom"])() |>
assign_age_groups(age_limits = c(0, 5, 15)) |>
compute_matrix() |>
per_capita(survey_pop = pop)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.