Learn R Programming

brfinance (version 0.8.0)

plot_exchange_rate: Plot Brazilian exchange rate (USD/BRL)

Description

Generates a time series plot of the USD/BRL exchange rate using data from get_exchange_rate(). Shows the commercial exchange rate for US Dollar to Brazilian Real.

Usage

plot_exchange_rate(data, language = "eng")

Value

A ggplot2 object showing the exchange rate over time.

Arguments

data

Tibble returned by get_exchange_rate()

language

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

Examples

Run this code
if (FALSE) { # interactive()
# Example 1: English version
exchange_data <- get_exchange_rate("2023-01-01", "2023-12-31")
exchange_plot <- plot_exchange_rate(exchange_data)
print(exchange_plot)

# Example 2: Portuguese version
dados_cambio <- get_exchange_rate("2023-01-01", "2023-12-31", language = "pt")
grafico_cambio <- plot_exchange_rate(dados_cambio, language = "pt")
print(grafico_cambio)
}

Run the code above in your browser using DataLab