Package 'aebdata'

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

Help Index


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