# Selic and Interest Rates

## get_selic_rate()

Downloads the daily SELIC rate series from Central Bank of Brazil.

### Parameters

- `start_year`: Starting year (e.g., 2020)
- `end_year`: Ending year (e.g., 2024)
- `language`: Column names language - `"eng"` (default) or `"pt"`

### Usage

    library(brfinance)

    # English version
    selic_eng <- get_selic_rate(2020, 2024)
    head(selic_eng)
    #>         date    value value_annualized
    #> 1 2020-01-02 0.017089         4.400116
    #> 2 2020-01-03 0.017089         4.400116
    #> 3 2020-01-06 0.017089         4.400116
    #> 4 2020-01-07 0.017089         4.400116
    #> 5 2020-01-08 0.017089         4.400116
    #> 6 2020-01-09 0.017089         4.400116

    # Portuguese version
    selic_pt <- get_selic_rate(2020, 2024, language = "pt")
    head(selic_pt)
    #>         date    value value_annualized
    #> 1 2020-01-02 0.017089         4.400116
    #> 2 2020-01-03 0.017089         4.400116
    #> 3 2020-01-06 0.017089         4.400116
    #> 4 2020-01-07 0.017089         4.400116
    #> 5 2020-01-08 0.017089         4.400116
    #> 6 2020-01-09 0.017089         4.400116

## plot_selic_rate()

Creates a time series plot of SELIC rate.

### Parameters

- `data`: Data from `get_selic_rate()`
- `language`: Plot labels language - `"eng"` (default) or `"pt"`

### Usage

    # Get data
    selic_data <- get_selic_rate(2020, 2024)

    # Create plot
    selic_plot <- plot_selic_rate(selic_data, language = "eng")
    print(selic_plot)

    # Portuguese version
    selic_data_pt <- get_selic_rate(2000,2005, language = "pt")

    selic_plot_pt <- plot_selic_rate(selic_data_pt, language = "pt")
    print(selic_plot_pt)