View source: R/user_aggregate_count.R
| aggregate_count | R Documentation |
Sums counts over event/population arrays. Useful when manually generating group-aggregated/age-standardized estimates and a population threshold is needed for suppression.
aggregate_count(
count,
margin,
groups = NULL,
bind_new = FALSE,
new_name = NULL
)
count |
The |
margin |
For |
groups |
A vector of either indices for each group or a vector of strings for each group name. If set to |
bind_new |
If set to |
new_name |
The name to assign to the age-standardized group. |
An array of aggregated count data.
margin_time <- 3
# aggregate population from all years for each county-group
pop_7988 <- aggregate_count(miheart$n, margin_time)
# aggregate population from 1980-1984 for each county-group
pop_8084 <- aggregate_count(miheart$n, margin_time, groups = as.character(1980:1984))
# bind aggregated pop from all years to population data
pop_agg <- aggregate_count(miheart$n, margin_time, bind_new = TRUE, new_name = "1979-1988")
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.