Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

cep_to_state

Determine the state of a given CEP postal code


Description

Zips codes in Brazil are known as CEP, the abbreviation for postal code address. CEPs in Brazil are 8 digits long, with the format 'xxxxx-xxx'.

Usage

cep_to_state(cep)

Arguments

cep

A numeric string with 8 digits in the format xxxxxxxx, or a character with the format 'xxxxx-xxx'.

Value

A character string with a state abbreviation

Examples

uf <- cep_to_state(cep = '69900-000')

# Or:
uf <- cep_to_state(cep = 69900000)

geobr

Download Official Spatial Data Sets of Brazil

v1.6.1
MIT + file LICENSE
Authors
Rafael H. M. Pereira [aut, cre] (<https://orcid.org/0000-0003-2125-7465>), Caio Nogueira Goncalves [aut], Paulo Henrique Fernandes de Araujo [ctb], Guilherme Duarte Carvalho [ctb], Rodrigo Almeida de Arruda [ctb], Igor Nascimento [ctb], Barbara Santiago Pedreira da Costa [ctb], Welligtton Silva Cavedo [ctb], Pedro R. Andrade [ctb], Alan da Silva [ctb], Carlos Kauê Vieira Braga [ctb], Carl Schmertmann [ctb], Alessandro Samuel-Rosa [ctb], Daniel Ferreira [ctb], Ipea - Institue for Applied Economic Research [cph, fnd]
Initial release
2021-04-15

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.