convert_currency: Convert Currency Exchange Rate

View source: R/convert_currency.r

convert_currencyR Documentation

Convert Currency Exchange Rate

Description

Get currency exchange rate between two currencies input by the user.

Arguments

from

String with the currency to change from. The format should be "XXX", for example "USD"

to

String with the currency to change to. The format should be "XXX", for example "CAD"

Details

This function need the user input the currency to change from and the currency to change to.

Value

It will return a character vector of length two. The first element is the exchange rate. The second element is the date. If there is an error, it will return error and get the error message.

the column will be the specific date currency exchange rate and the row will be the aim currency for that exchange rate.

References

https://exchangerate.host/#/

Examples

## Not run: 
convert_currency("CAD", "USD")

## End(Not run)

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