Learn R Programming

ColOpenData (version 1.0.0)

name_to_code_mun: Retrieve municipalities' DIVIPOLA codes from names

Description

Retrieve municipalities' DIVIPOLA codes from their names. Since there are municipalities with the same names in different departments, the input must include two vectors: one for the departments and one for the municipalities in said departments. If only one department is provided, it will try to match all municipalities in the second vector inside that department. Otherwise, the vectors must be the same length.

Usage

name_to_code_mun(department_name, municipality_name)

Value

character vector with the DIVIPOLA codes of the municipalities.

Arguments

department_name

character vector with the names of the departments containing the municipalities.

municipality_name

character vector with the names of the municipalities.

Examples

Run this code
if (FALSE) { # identical(tolower(Sys.getenv("NOT_CRAN")), "true")
dptos <- c("Huila", "Antioquia")
mpios <- c("Pitalito", "Turbo")
name_to_code_mun(dptos, mpios)
}

Run the code above in your browser using DataLab