changes_groups: Group together municipalities that were once merged.

View source: R/changes_groups.R

changes_groupsR Documentation

Group together municipalities that were once merged.

Description

Group together municipalities that were once merged.

Usage

changes_groups(
  y_start,
  y_end,
  prov = NULL,
  partial_changes = FALSE,
  checks = FALSE
)

Arguments

y_start

Integer, earliest year for which changes are considered

y_end

Integer, latest year for which changes are considered

prov

If a list of provinces is specified, only municipalities in those provinces are returned (Character vector, detault = NULL). If NULL, all provinces are included.

Accepts official names, case-insentitive: Alava, Albacete, Alicante, Almeria, Avila, Badajoz, Baleares, Barcelona, Burgos, Caceres, Cadiz, Castellon, Ceuta, Ciudad Real, Cordoba, A Coruna, Cuenca, Girona, Granada, Guadalajara, Gipuzkoa, Huelva, Huesca, Jaen, Leon, Lleida, La Rioja, Lugo, Madrid, Malaga, Melilla, Murcia, Navarra, Ourense, Asturias, Palencia, Las Palmas, Pontevedra, Salamanca, Santa Cruz de Tenerife, Cantabria, Segovia, Sevilla, Soria, Tarragona, Teruel, Toledo, Valencia, Valladolid, Bizkaia, Zamora, Zaragoza.

partial_changes

(*In progress*) If TRUE, all municipalities that suffered partial changes will also be merged (Logical, default = FALSE).

Partial changes refers to those cases where only a part of a municipality is affected, either because it gets transfered to another municipality or because a whole municipality splits and its territories become part of different municipalities.

checks

If TRUE, checks whether output includes all municipalities and no municipality is included in two groups (Logical, default = FALSE). *Note:* this option increases running time considerably.

Value

A character vector with the municipality codes group together in each string, separated by ';'.

Examples

ch_euk = changes_groups(1930, 1970,
  prov = c("gipuzkoa", "alava", "bizkaia"), checks = TRUE)
head(ch_euk)
tail(ch_euk)


franvillamil/muniSpain documentation built on June 1, 2024, 4:31 a.m.