Skip to contents

brazil_region() returns a vector with the names of Brazilian regions.

Usage

brazil_region(x = NULL)

Arguments

x

(optional) An atomic vector containing the names, abbreviations, or numeric codes of Brazilian states or federal units. Region and municipality codes are also supported. If NULL, returns a vector with all Brazilian regions. (default: NULL)

Value

A character vector with the names of Brazilian regions.

Details

The data from this function is based on data from the Brazilian Institute of Geography and Statistics (IBGE, n.d.).

References

Instituto Brasileiro de Geografia e Estatística. (n.d.). Território [Territory] [Dataset]. SIDRA. https://sidra.ibge.gov.br/territorio

Examples

brazil_region()
#> [1] "North"        "Northeast"    "South"        "Southeast"   
#> [5] "Central-West"
#> [1] "North" "Northeast" "South" "Southeast" "Central-West" # Expected

brazil_region("sp")
#> [1] "Southeast"
#> [1] "Southeast" # Expected

brazil_region("sao paulo")
#> [1] "Southeast"
#> [1] "Southeast" # Expected

brazil_region(c(1, 4))
#> [1] "North" "South"
#> [1] "North" "South" # Expected

brazil_region(35) # State of São Paulo
#> [1] "Southeast"
#> [1] "Southeast" # Expected

brazil_region(3550308) # Municipality of São Paulo
#> [1] "Southeast"
#> [1] "Southeast" # Expected

brazil_region(35503081) # >7 digits
#> [1] NA
#> [1] NA # Expected