| get_cdi_rate | R Documentation |
Downloads daily CDI (Certificado de Depósito Interbancário) rate from BCB/SGS. This function retrieves the daily CDI rate (SGS series 12), which is the benchmark interest rate for interbank transactions in Brazil.
get_cdi_rate(
start_date = NULL,
end_date = NULL,
language = "eng",
labels = TRUE
)
start_date |
Start date for the data period. Accepts multiple formats:
|
end_date |
End date for the data period. Accepts the same formats as
|
language |
Language for column names in the returned data.frame:
|
labels |
Logical indicating whether to add variable labels using the |
A data.frame with columns:
Reference date
Daily CDI rate (% per day)
Annualized CDI rate (% per year, 252 business days)
Series information: This function uses SGS series 12, which represents the daily CDI rate (taxa de juros - CDI). The CDI is a key benchmark for fixed income investments and interbank lending in Brazil. Data is available from 1986 onward with daily frequency (business days only).
# Default: last 30 days of CDI rate
df <- get_cdi_rate()
# Specific period
df2 <- get_cdi_rate("2023-01-01", "2023-03-31")
# Using year-month format for a specific month
df3 <- get_cdi_rate("2023-06", "2023-06")
# Portuguese column names and labels
df4 <- get_cdi_rate(language = "pt")
# Complete example with all parameters
df5 <- get_cdi_rate("2023-01-01", "2023-12-31", language = "pt", labels = TRUE)
# Historical analysis
df6 <- get_cdi_rate("2020-03-01", "2020-04-30") # COVID period
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.