#knitr::opts_chunk$set(echo = TRUE)
library(ribge)
#library(knitr)
options(knitr.table.format = 'markdown')

Table with all series from IBGE's Séries Estatísticas & Séries Históricas.

After loading ribge package, you can find the same data in the seriesEstatisticas data_frame. You may load a given series with the following code:

df <- series_estatisticas_carrega(codigo + "_" + nivel_geo + "_" + "ABS"|"PERC")

where codigo is the dataset identifier and nivel_geo the geographical level and can be one of:

Both codigo and nivel_geo can be found in the seriesEstatisticas data_frame (shown bellow).

You also need to add ABS (absolute) or PERC (percentage) to the functions's argument depending on its datatype.

Other parameters for series_estatisticas_carrega:

Some examples:

The Table

#see http://kbroman.org/knitr_knutshell/pages/figs_tables.html
s <- seriesEstatisticas
s$descricao <- gsub("[\r\n]+", " ", s$descricao)
knitr::kable(s, digits=2)


tbrugz/ribge documentation built on Feb. 24, 2024, 7 p.m.