swc_get_merger_mapping_table: Create mapping table for a certain time interval

View source: R/get_merger_mapping_table.R

swc_get_merger_mapping_tableR Documentation

Create mapping table for a certain time interval

Description

Produces a mapping table that can be joined to your data. Municipalities that were merged to another municipality during the given time period are mapped to that municipality. Filtering by canton is supported.

Usage

swc_get_merger_mapping_table(
  start_year,
  end_year,
  canton = NULL,
  type = "flat"
)

Arguments

start_year

First year of time interval (integer)

end_year

Last year of time interval (integer)

canton

Canton abbreviation as character (e.g. "GE", "ZH", "TI", etc.) to focus on. If left 'NULL' (default) all cantons are considered.

type

Two options:

- "flat" (default) returns the table with one row per year per mapping

- "compact" returns a more compact table with one row per mapping, containing the time interval it is valid for

Value

Mapping table for the given time interval in the specified canton

Examples

swc_get_merger_mapping_table(2005, 2010)
swc_get_merger_mapping_table(2015, 2019, canton = "ZH", type = "compact")

cynkra/munch documentation built on Dec. 15, 2024, 6:06 a.m.