Skip to content
A Package for Accessing the Municipal-level Data of the Instituto Brasileiro de Geografia e Estatistica (Brazilian Institute of Geography and Statistics)
R
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
R
data
man
.Rbuildignore
.gitignore
DESCRIPTION
LICENSE
LICENSE.md
NAMESPACE
README.Rmd
README.md
ibge.Rproj

README.md

ibge

The idea of ibge is to download and make available (in a tidy format) the data from the IBGE Cidades project.

There is a dataset of municipio codes, names and UFs included.

library(ibge)
data("ibge_codes")
head(ibge_codes)
#> # A tibble: 6 x 4
#>     codes municipio            uf    municipio_ascii     
#>     <int> <chr>                <chr> <chr>               
#> 1 1100015 Alta Floresta DOeste RO    Alta Floresta DOeste
#> 2 1100023 Ariquemes            RO    Ariquemes           
#> 3 1100031 Cabixi               RO    Cabixi              
#> 4 1100049 Cacoal               RO    Cacoal              
#> 5 1100056 Cerejeiras           RO    Cerejeiras          
#> 6 1100064 Colorado do Oeste    RO    Colorado do Oeste

Usage

The function historic() returns a one-line dataframe of information on the municipality selected. Since this may be of limited use, it also prints out a HTML page of the same information (in an interactive session only). If using RStudio, this will appear in the Viewer pane. This function returns data in the original Portuguese.
For example, let’s learn a little about Nova Olinda do Norte, in Amazonas state (I hope you’ve brushed up on your Brazilian Portuguese).

library(dplyr)

filter(ibge_codes, municipio == "Nova Olinda do Norte") %>% 
  pull(codes) %>% 
  historic()
#> # A tibble: 1 x 7
#>   municipio  state  uf    history  source_history  administrative_h… locals
#>   <chr>      <chr>  <chr> <chr>    <chr>           <chr>             <chr> 
#> 1 Nova Olin… Amazo… AM    "O nome… Biblioteca Vir… "Elevado à categ… olind…

Something like the following should appear in your Viewer pane:

You can’t perform that action at this time.