Learn R Programming

nomisdata (version 0.1.1)

aggregate_geography: Aggregate Data by Geography Level

Description

Aggregates data to higher geography levels.

Usage

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

Value

A tibble with aggregated data grouped by specified variables.

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)

Examples

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

Run the code above in your browser using DataLab