latest_rates: Latest Rates

View source: R/latest_rates.R

latest_ratesR Documentation

Latest Rates

Description

Get the latest foreign exchange reference rates of a list of currencies on a specific base at a specific amount on daily basis from the Exchange rates API.

Arguments

base

Enter the three-letter currency code of your preferred base currency (e.g., base='USD'), the default is base='EUR'.

symbols

Enter a list of comma-separated currency codes to limit output currencies (e.g., symbols=c('USD','EUR','CZK')), the default is all of the 170+ currencies.

amount

The amount to be converted (e.g., amount=1200), the default is amount=1.

Details

This function need the user input the base currency, symbols the list of currencies, and the amount for getting the reference rates.

Value

It will return a dataframe with the columns Date, Base, Rates, and Amount. If there is an error, it will return error and get the error message.

References

https://exchangerate.host/#/

Examples

## Not run: 
latest_rates('CNH','USD,EUR,CAD',5000)
latest_rates(symbols='CAD,USD,CNH')

## End(Not run)

ysun822/currencychecker documentation built on March 26, 2022, 2:39 a.m.