powered by
This function retrieves data from multiple Central Bank series, given a vector of series IDs and corresponding names.
bacen_series(series, names, start_date, end_date, httr = TRUE)
A `data.frame` containing the retrieved series data.
A numeric vector containing the series IDs from Central Bank API.
A character vector containing the names corresponding to each series.
A string specifying the start date in "dd/mm/yyyy" format.
A string specifying the end date in "dd/mm/yyyy" format.
A logical value indicating whether to use `httr` (`TRUE`) or `httr2` (`FALSE`). Default is `TRUE`.
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