brcities logo

Travis-CI Build Status Coverage status AppVeyor Build Status

knitr::opts_chunk$set(
  collapse = TRUE,
  comment = "#>",
  fig.path = "man/figures/README-",
  out.width = "100%"
)
options(knitr.table.format = "html") 

Overview

The goal of brcities is to download Brazilian cities' indicators from the Brazilian National Institute of Geography and Statistics, aka IBGE. For the time being, it also downloads cities demographics from Fundação Seade in São Paulo. We hope to add more data from states' level government sources.

All available functions and datasets start with two letters indicating the source of the information. So if the Federal Government is the source, they start with br followed by and underscore and the remaining of the function name. Likewise, if the source is São Paulo, the function will start with sp. Once we add more sources from the states, all functions will start either with br_ or uf_ and the user will have to provide the name of the state.

Installation

You can install brcities from GitHub with:

# install.packages("devtools")
devtools::install_github("abjur/brcities")

Usage

The br_city_indicators() function returns a tibble with the indicators from the state cities. A list of all indicators is at the end of this readme.

pop_ac<-br_city_indicators(uf="ac",indicators=25207)

If you want data from São Paulo's state, check the documentation for sp_indicators() function. It provides lots of demographic indicators.

Datasets

The package provides five datasets: br_city_code containing IBGE code for every Brazilian city along with the respective state code, and also each cities' latlong, br_state_code containing IBGE code for every federative unity (states + the federal district), br_indicators_code with the IBGE indicator's numbers, sp_place with São Paulo places (cities and regions) codes, and sp_variable with the variables (indicators) code to get demographics from São Paulo.

IGBE's indicators

There are 28 indicators put available by IBGE. You can load them by calling:

``` {r eval=FALSE,echo=TRUE} data(br_indicators_code)

And also check them out right here:

```r
data("br_indicators_code")
library(knitr)
library(kableExtra)
kable(br_indicators_code, "html") %>%
  kable_styling(bootstrap_options = c("striped", "hover"))


jjesusfilho/cidades documentation built on May 17, 2019, 11:15 p.m.