-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathREADME.Rmd
75 lines (49 loc) · 3.06 KB
/
README.Rmd
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
---
output: github_document
always_allow_html: yes
---
# brcities <img src="man/figures/city.png" align="right" alt="logo" width="150" height = "150" style = "border: none; float: right;"/>
[](https://travis-ci.org/abjur/brcities)
[](https://codecov.io/github/abjur/brcities?branch=master)
[](https://ci.appveyor.com/project/jjesusfilho/brcities)
<!-- README.md is generated from README.Rmd. Please edit that file -->
```{r setup, include = FALSE}
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:
```{r gh-installation, eval = FALSE}
# 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.
```{r eval=FALSE}
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 echo=FALSE, message=FALSE, warning=FALSE }
data("br_indicators_code")
library(knitr)
library(kableExtra)
kable(br_indicators_code, "html") %>%
kable_styling(bootstrap_options = c("striped", "hover"))
```