Learn R Programming

brfinance (version 0.8.0)

plot_cdi_rate: Plot Brazilian CDI rate

Description

Generates a time series plot of the CDI (Certificado de Depósito Interbancário) rate. The CDI is the benchmark interest rate for interbank deposits in Brazil and serves as a reference for many fixed income investments.

Usage

plot_cdi_rate(data, language = "eng")

Value

A ggplot2 object showing the CDI rate over time.

Arguments

data

Tibble returned by get_cdi_rate(), with columns date and value.

language

Language for titles and labels: "pt" (Portuguese) or "eng" (English).

Examples

Run this code
if (FALSE) { # interactive()
# Example 1: English version
cdi_data <- get_cdi_rate(2020, 2024)
cdi_plot <- plot_cdi_rate(cdi_data)
print(cdi_plot)

# Example 2: Portuguese version
dados_cdi <- get_cdi_rate(2020, 2024, language = "pt")
grafico_cdi <- plot_cdi_rate(dados_cdi, language = "pt")
print(grafico_cdi)
}

Run the code above in your browser using DataLab