get_currency_cross_rates: Get currency matrix from BCB

View source: R/rbcb_get_currencies.R

get_currency_cross_ratesR Documentation

Get currency matrix from BCB

Description

The currency matrix has the currency cross rates for all currencies present in the BCB system.

Usage

get_currency_cross_rates(date, ref = c("ask", "bid"))

Arguments

date

reference date

ref

reffers to bid or ask rates (default ask)

date is the reference date by which the currency rates must be downloaded. ref defaults to ask and bid returns all currency cross rates calculated with bid rates.

Value

A square matrix with colnames and rownames filled with currency symbols The cells must be read as ROW in COL, for example, BRL (row) in USD (column) means Brazilian Reals in American Dollars.

Examples

## Not run: 
x <- get_currency_cross_rates("2017-03-10")
currencies <- c("USD", "BRL", "AUD", "EUR", "CAD")
x[currencies, currencies]

## End(Not run)

rbcb documentation built on Oct. 13, 2023, 1:10 a.m.