latest_rates | R Documentation |
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.
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. |
This function need the user input the base currency, symbols the list of currencies, and the amount for getting the reference rates.
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.
## Not run: latest_rates('CNH','USD,EUR,CAD',5000) latest_rates(symbols='CAD,USD,CNH') ## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.