View source: R/get_usd_exchange_rates.R
get_usd_exchange_rates | R Documentation |
This function retrieves the latest exchange rates of the US dollar (USD) from multiple currency exchange houses in Argentina, using the public API 'https://api.argentinadatos.com/v1/cotizaciones/dolares'. The results are sorted in descending order by date (most recent first).
get_usd_exchange_rates()
The function connects to the ArgentinaDatos API to obtain current USD exchange rates. It arranges the results in descending order by date, making recent data easier to access.
A data frame (tibble) with the following columns:
casa
: Name of the exchange house (e.g., Blue, Oficial, Mayorista).
compra
: Buying rate (numeric).
venta
: Selling rate (numeric).
fecha
: Date of the rate (Date format).
Requires an internet connection. Results may vary depending on API availability.
GET
, fromJSON
, arrange
## Not run:
# Get latest USD exchange rates
rates <- get_usd_exchange_rates()
head(rates) # Shows the most recent ones first
# Filter for the year 2025
rates_2025 <- dplyr::filter(rates, lubridate::year(fecha) == 2025)
## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.