Learn R Programming

censuspyrID (version 1.0.2)

pop_data_by_reg: Filter Population Data by Province

Description

Filter population data based on a specified province ID. This function is intended for use with population datasets loaded via load_pop_data(), but can work with any data frame that includes a province_id column.

Usage

pop_data_by_reg(data, reg)

Value

A tibble (or data frame) containing only rows for the specified province.

Arguments

data

A data frame or tibble containing population data. Must include a column named province_id.

reg

Integer or character. The province ID to filter by.

See Also

load_pop_data(), pop_data_by_year()

Examples

Run this code
# Load harmonized data
dat <- load_pop_data(harmonized = TRUE, smoothing = 1)

# Filter data for province ID 0 (Indonesia)
pop_data_by_reg(dat, reg = 0)

Run the code above in your browser using DataLab