get_brazil_municipality()
returns a tibble
with data
about Brazilian municipalities.
Arguments
- municipality
(Optional) A
character
vector with the name of the municipalities. IfNULL
the function returns all municipalities (Default:NULL
).- state
(Optional) A
character
vector with the name of the states (Default:NULL
).- year
(Optional) An
integerish
number indicating the year of the data regarding the municipalities (Default:2017
).- force
(Optional) A
logical
flag indicating whether to force the download of the data again (Default:FALSE
).
Value
A tibble
with the following columns:
municipality
: The municipality name.municipality_code
: The municipality code.state_code
: The state code.state
: The state name.federal_unit
: The state abbreviation.country
: The country name.
Details
The data from this function is based on data from the Brazilian Institute
of Geography and Statistics (IBGE) via the
geobr
R package.
The geobr
package is produced by Brazil's Institute for Applied
Economic Research (IPEA) and access the
Brazilian Institute of Geography and Statistics (IBGE) data. You can see a
list of all geobr
datasets by running
geobr::list_geobr()
.
See also
Other Brazil functions:
get_brazil_fu()
,
get_brazil_municipality_code()
,
get_brazil_region()
,
get_brazil_state()
,
get_brazil_state_by_utc()
,
get_brazil_state_capital()
,
get_brazil_state_code()
,
get_brazil_state_latitude()
,
get_brazil_state_longitude()
,
render_brazil_address()
Examples
get_brazil_municipality() |> dplyr::glimpse()
#> Rows: 5,570
#> Columns: 6
#> $ municipality <chr> "Alta Floresta D'Oeste", "Ariquemes", "Cabixi", "Cac…
#> $ municipality_code <int> 1100015, 1100023, 1100031, 1100049, 1100056, 1100064…
#> $ state_code <int> 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, …
#> $ state <chr> "Rondônia", "Rondônia", "Rondônia", "Rondônia", "Ron…
#> $ federal_unit <chr> "RO", "RO", "RO", "RO", "RO", "RO", "RO", "RO", "RO"…
#> $ country <chr> "Brazil", "Brazil", "Brazil", "Brazil", "Brazil", "B…
get_brazil_municipality(municipality = "Belém")
#> # A tibble: 3 × 6
#> municipality municipality_code state_code state federal_unit country
#> <chr> <int> <int> <chr> <chr> <chr>
#> 1 Belém 1501402 15 Pará PA Brazil
#> 2 Belém 2501906 25 Paraíba PB Brazil
#> 3 Belém 2700805 27 Alagoas AL Brazil
get_brazil_municipality(municipality = "Belém", state = "Pará")
#> # A tibble: 1 × 6
#> municipality municipality_code state_code state federal_unit country
#> <chr> <int> <int> <chr> <chr> <chr>
#> 1 Belém 1501402 15 Pará PA Brazil
get_brazil_municipality(municipality = c("Belém", "São Paulo"))
#> # A tibble: 4 × 6
#> municipality municipality_code state_code state federal_unit country
#> <chr> <int> <int> <chr> <chr> <chr>
#> 1 Belém 1501402 15 Pará PA Brazil
#> 2 Belém 2501906 25 Paraíba PB Brazil
#> 3 Belém 2700805 27 Alagoas AL Brazil
#> 4 São Paulo 3550308 35 São Paulo SP Brazil