Title: | Access Data from the Atlas do Estado Brasileiro |
Version: | 0.1.4 |
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. |
License: | GPL (≥ 3) |
Encoding: | UTF-8 |
RoxygenNote: | 7.3.2 |
Depends: | R (≥ 4.2.0) |
Suggests: | knitr, rmarkdown, stringi, testthat (≥ 3.0.0) |
Config/testthat/edition: | 3 |
URL: | https://github.com/ipea/aebdata |
BugReports: | https://github.com/ipea/aebdata/issues |
Imports: | httr2, readr, rvest |
VignetteBuilder: | knitr |
NeedsCompilation: | no |
Packaged: | 2025-02-03 17:29:48 UTC; B12168223793 |
Author: | Hugo Macedo [aut, cre, cph] |
Maintainer: | Hugo Macedo <aebdata@hhmace.do> |
Repository: | CRAN |
Date/Publication: | 2025-02-03 17:50:02 UTC |
Get series values
Description
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.
Usage
get_series(series_id = NULL, series_title = NULL)
Arguments
series_id , series_title |
The series ids or titles to download |
Details
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.
Value
A data.frame or a list containing the data from the series
Examples
# 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 created series
Description
List all series from the Atlas, regardless of whether they have data available for download or not.
Usage
list_series(theme_id = NULL, theme_title = NULL)
Arguments
theme_id , theme_title |
Optional parameters that can be used individually or combined to filter the selected themes. |
Value
A data.frame
Examples
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 available themes
Description
list_themes()
returns a data.frame containing all available themes and
their corresponding ids.
Usage
list_themes()
Value
A data.frame
Examples
# Get the data frame and show the theme titles
themes <- list_themes()
themes$theme_title
Search for specific words
Description
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.
Usage
search_series(words, case_insensitive = TRUE, require_all = FALSE)
Arguments
words |
A word or an array of words to check |
case_insensitive |
Ignore the difference between uppercase and lowercase |
require_all |
Require all words |
Value
A data.frame
Examples
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