fluctuation: Currency Fluctuate

View source: R/fluctuation.R

fluctuationR Documentation

Currency Fluctuate

Description

Retrieve information about how a list of currencies fluctuate on a specific base at a specific amount on a day-to-day basis from the Exchange rates API.

Arguments

start_date

The start date of your preferred fluctuation timeframe (e.g. start='2020-01-01').

end_date

The end date of your preferred fluctuation timeframe (e.g. end='2020-01-01').

base

Changing base currency. 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 start date, the end date, 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 Start, End, Base, Rates.start_rate, Rates.end_rate, Rates.change_pct, and Amount. If there is an error, it will return error and get the error message.

References

https://exchangerate.host/#/

Examples

## Not run: 
fluctuation('2022-01-01','2022-02-10')
fluctuation('2021-01-01','2021-12-10', symbols='CAD,USD')
fluctuation('2021-03-10','2021-11-15', symbols='CAD,USD,CZK', amount=1000)

## End(Not run)

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