Learn R Programming

brfinance (version 0.8.0)

.get_sgs_series: Download SGS series from Brazilian Central Bank

Description

Internal helper function to download time series data from BCB SGS API. Uses httr2 for robust HTTP requests with automatic fallback strategy.

Usage

.get_sgs_series(series_id, start_date = NULL, end_date = NULL)

Value

A data.frame with columns 'date' (Date) and 'value' (numeric).

Arguments

series_id

Numeric. SGS series ID.

start_date

Start date (YYYY, YYYY-MM, or YYYY-MM-DD format).

end_date

End date (YYYY, YYYY-MM, YYYY-MM-DD format, or NULL for current date).

Examples

Run this code
if (FALSE) { # interactive()
# Example: download SELIC series (ID 432)
df <- brfinance:::.get_sgs_series(432, "2020", "2021")

head(df)
tail(df)
}

Run the code above in your browser using DataLab