Convenience wrapper around estban_download() and estban_read() for a
range of reference months. Months that are not published are skipped
with a warning, so the result may cover fewer months than requested;
check unique(result$ref).
Usage
estban_fetch(
start,
end = start,
uf = NULL,
level = c("agencia", "municipio"),
cache_dir = NULL,
clean_names = TRUE,
force = FALSE,
verbose = TRUE
)Arguments
- start, end
Reference months as
AAAAMM;enddefaults tostart.- uf
Optional character vector of two-letter state codes to keep (e.g.
"PE"orc("PE", "PB")).NULLkeeps every state.- level
"agencia"(one row per bank branch, the default) or"municipio"(one row per institution and municipality).- cache_dir
Directory for downloaded files. See
estban_cache_dir()for the resolution order; the default is a session folder underbase::tempdir().- clean_names
Logical. Convert column names to
snake_casewithestban_clean_names()(defaultTRUE). WithFALSEthe original upper-case names are kept, including the leading#of#DATA_BASE.- force
Logical. Re-download even when the CSV is already cached.
- verbose
Logical. Emit progress messages (default
TRUE).
Value
A tibble with all requested months stacked (see estban_read()).