Learn R Programming

BacenAPI (version 0.1.1)

bacen_series: Fetch Multiple Central Bank Series

Description

This function retrieves data from multiple Central Bank series, given a vector of series IDs and corresponding names.

Usage

bacen_series(series, names, start_date, end_date, httr = TRUE)

Value

A `data.frame` containing the retrieved series data.

Arguments

series

A numeric vector containing the series IDs from Central Bank API.

names

A character vector containing the names corresponding to each series.

start_date

A string specifying the start date in "dd/mm/yyyy" format.

end_date

A string specifying the end date in "dd/mm/yyyy" format.

httr

A logical value indicating whether to use `httr` (`TRUE`) or `httr2` (`FALSE`). Default is `TRUE`.

Examples

Run this code
series <- c('433', '13005')
names <- c('ipca_br', 'ipca_for')
data <- bacen_series(series, names,
"01/01/2020", "31/12/2023",
httr = TRUE) # in the format "dd/mm/yyyy"



Run the code above in your browser using DataLab