#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
:
localidade=Todas
may be useful for some datasets)Some examples:
series_estatisticas_carrega("FDT221_BR_PERC")
- Employment-to-population ratio, 1992-2007 (BR, percentage)series_estatisticas_carrega("FDT800_BR_ABS")
- Average income from wages, 1981-2007 (BR, absolute)#see http://kbroman.org/knitr_knutshell/pages/figs_tables.html s <- seriesEstatisticas s$descricao <- gsub("[\r\n]+", " ", s$descricao) knitr::kable(s, digits=2)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.