Title: | Access Data from the Atlas do Estado Brasileiro |
---|---|
Description: | Facilitates access to the data from the Atlas do Estado Brasileiro (<https://www.ipea.gov.br/atlasestado/>), maintained by the Instituto de Pesquisa Econômica Aplicada (Ipea). It allows users to search for specific series, list series or themes, and download data when available. |
Authors: | Hugo Macedo [aut, cre, cph] |
Maintainer: | Hugo Macedo <[email protected]> |
License: | GPL (>= 3) |
Version: | 0.1.2 |
Built: | 2024-12-11 06:44:07 UTC |
Source: | CRAN |
The function get_series()
is the main function of this package. Its goal
is to facilitate direct access to the data published in the Atlas do Estado
Brasileiro so that the user can work with them as they wish.
get_series(series_id = NULL, series_title = NULL)
get_series(series_id = NULL, series_title = NULL)
series_id , series_title
|
The series ids or titles to download |
If the parameter used is for just one series, the result will be a data.frame containing the requested information. Now, if the parameter refers to more than one series, the return will be a list of data.frames, with each data.frame corresponding to a series.
A data.frame or a list containing the data from the series
# Get the series 230 and print the head serie_230 <- get_series(series_id = 230) head(serie_230) # Get the series from 230 to 232 and print the head of the 232 series <- get_series(series_id = 230:232) head(series[["232"]])
# Get the series 230 and print the head serie_230 <- get_series(series_id = 230) head(serie_230) # Get the series from 230 to 232 and print the head of the 232 series <- get_series(series_id = 230:232) head(series[["232"]])
List all series from the Atlas, regardless of whether they have data available for download or not.
list_series(theme_id = NULL, theme_title = NULL)
list_series(theme_id = NULL, theme_title = NULL)
theme_id , theme_title
|
Optional parameters that can be used individually or combined to filter the selected themes. |
A data.frame
series <- list_series(theme_id = c(42, 50)) series$series_title # List all series and count the number of series available all_series <- list_series() length(unique(all_series$series_id)) # Count the number of series from Organizações do Estado theme organizacoes <- list_series(theme_title = "Organizações do Estado") nrow(organizacoes)
series <- list_series(theme_id = c(42, 50)) series$series_title # List all series and count the number of series available all_series <- list_series() length(unique(all_series$series_id)) # Count the number of series from Organizações do Estado theme organizacoes <- list_series(theme_title = "Organizações do Estado") nrow(organizacoes)
list_themes()
returns a data.frame containing all available themes and
their corresponding ids.
list_themes()
list_themes()
A data.frame
# Get the data frame and show the theme titles themes <- list_themes() themes$theme_title
# Get the data frame and show the theme titles themes <- list_themes() themes$theme_title
The search_series()
function provides a quick way to access a list of
series that may be of interest, along with their respective IDs. Each series
appears according to the number of themes it is present in.
If one result should appear before the other, the result can be sorted by using the word multiple times in the search, thus giving it greater importance.
search_series(words, case_insensitive = TRUE, require_all = FALSE)
search_series(words, case_insensitive = TRUE, require_all = FALSE)
words |
A word or an array of words to check |
case_insensitive |
Ignore the difference between uppercase and lowercase |
require_all |
Require all words |
A data.frame
search_result <- search_series("regime de contratação") search_result$series_title search_result <- search_series(c("remuneração", "raça"), require_all = TRUE) search_result$series_title
search_result <- search_series("regime de contratação") search_result$series_title search_result <- search_series(c("remuneração", "raça"), require_all = TRUE) search_result$series_title