aggregate_geography: Aggregate Data by Geography Level

View source: R/aggregate.R

aggregate_geographyR Documentation

Aggregate Data by Geography Level

Description

Aggregates data to higher geography levels.

Usage

aggregate_geography(data, to_type, value_col = "OBS_VALUE", fun = sum)

Arguments

data

Data frame with geography codes

to_type

Target geography TYPE code

value_col

Column containing values to aggregate (default: "OBS_VALUE")

fun

Aggregation function (default: sum)

Value

A tibble with aggregated data grouped by specified variables.

Examples

data(jsa_sample)
aggregated <- aggregate_geography(jsa_sample, "TYPE499", "OBS_VALUE")
head(aggregated)

nomisdata documentation built on Feb. 10, 2026, 5:10 p.m.