powered by
Aggregates data to higher geography levels.
aggregate_geography(data, to_type, value_col = "OBS_VALUE", fun = sum)
A tibble with aggregated data grouped by specified variables.
Data frame with geography codes
Target geography TYPE code
Column containing values to aggregate (default: "OBS_VALUE")
Aggregation function (default: sum)
data(jsa_sample) aggregated <- aggregate_geography(jsa_sample, "TYPE499", "OBS_VALUE") head(aggregated)
Run the code above in your browser using DataLab