str_mxmunicipio: Format municipio codes with leading zeroes

Description Usage Arguments Value See Also Examples

View source: R/string.R

Description

Format municipio codes with leading zeroes

Usage

1
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

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
# 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 July 11, 2018, 12:21 p.m.