The municipality inventory can also be used to learn more about how the number of municipalities evolved over time in Switzerland.
# Import the municipality inventory
<- import_CH_municipality_inventory(file_path = path_inventory_xml)
mutations_object
# Specify a date vector
<- seq.Date(from = as.Date("1980-01-01"), to = as.Date("2020-01-01"), by = "1 year")
dates
# Obtain the municipality count for this date vector
<- municipality_counter(mutations_object$mutations, dates, geo_level = "ch")
sy_municipality
# Second example for one point in time:
<- municipality_counter(mutations_object$mutations, "2001-04-04", geo_level = "ch") sy_municipality
<- import_CH_municipality_inventory(file_path = path_inventory_xml)
mutations_object
<- seq.Date(from = as.Date("1980-01-01"), to = as.Date("2020-01-01"), by = "1 year")
dates <- municipality_counter(mutations_object$mutations, dates, geo_level = "cantons") sy_municipality