str_mxmunicipio: Format municipio codes with leading zeroes

View source: R/string.R

str_mxmunicipioR Documentation

Format municipio codes with leading zeroes

Description

Format municipio codes with leading zeroes

Usage

str_mxmunicipio(code, municipio_code)

Arguments

code

The sate or combined state and municipio code if the municipio_code variable is missing

municipio_code

The municipio code

Value

The state and municipio code in the format required by the plotting functions

See Also

http://www.inegi.org.mx/est/contenidos/proyectos/aspectosmetodologicos/clasificadoresycatalogos/catalogo_entidades.aspx

Examples

# Format the concatenated string of state code + municipio code
str_mxmunicipio(c("1006", "2003"))
# Format the state and municipio code separately
str_mxmunicipio(c(10, 6), c(20, 3))

## Not run: 
# warning about invalid code
str_mxmunicipio(33, 999)

## End(Not run)

diegovalle/mxmaps documentation built on Sept. 22, 2023, 9:57 p.m.