Skip to contents

Unified interface for accessing all realestatebr datasets. Resolves data from the package's GitHub release assets when possible (fast, pre-processed, updated weekly by CI) and falls back to a fresh download from the original source. Repeated calls within one R session are served from an in-memory memo to avoid redundant network traffic.

Usage

get_dataset(name, table = NULL, source = "auto", quiet = FALSE)

Arguments

name

Character. Dataset name (see list_datasets for options). Each dataset has its own help topic documenting tables and columns: abecip, abrainc, bcb_realestate, bcb_series, fgv_ibre, rppi, rppi_bis, and secovi.

table

Character. Specific table within a multi-table dataset. See get_dataset_info for available tables per dataset.

source

Character. Data source preference:

"auto"

Use the in-session memo if available, otherwise GitHub releases, otherwise fresh download (default).

"github"

Pre-processed asset from the package's GitHub release.

"fresh"

Fresh download from the original source.

Use clear_session_cache to drop the in-session memo.

quiet

Logical. If TRUE, suppresses informational messages. Errors and warnings are still shown.

Value

A tibble or named list, depending on the dataset. Use get_dataset_info to inspect the expected structure.

Details

To restrict a time series to a date window, filter the returned date column with dplyr::filter().

See also

list_datasets for available datasets, get_dataset_info for dataset details, clear_session_cache to drop the in-session memo. For table and column documentation of each dataset, see the dataset help topics: abecip, abrainc, bcb_realestate, bcb_series, fgv_ibre, rppi, rppi_bis, secovi.

Examples

if (FALSE) { # interactive()
abecip_data <- get_dataset("abecip")

sbpe_data <- get_dataset("abecip", table = "sbpe")

bcb_data <- get_dataset("bcb_series", quiet = TRUE)

bcb_recent <- dplyr::filter(bcb_data, date >= as.Date("2020-01-01"))
}