fxtrackerR-vignette.Rmd
library(fxtrackerR)This is a R package created as a group project for DSCI_524 Collaborative Software Development of UBC Master of Data Science (MDS) program 2022-2023. Based on the foreign exchange data in Yahoo Finance, this package allows user to perform currency conversion based on the latest available exchange rate, lookup a target exchange rate from historical data as well plotting exchange rate history and profit/loss percentage history by specifying a currency pair (and other input parameters).
fx_conversion Convert the input amount of currency 1 to
currency 2 based on the latest available exchange rate.fx_rate_lookup Lookup for the most recent date on which
the input target price happened. i.e. the target price was within the
day’s high/low of the day.price_trend_viz Plot the historical exchange rate of
the input currency pair for a specific period of time.pl_trend_viz Plot the historical profit/loss percentage
of the input currency pair for a specific period of time.There is a R package czechrates
relevant to foreign exchange. The package only provides foreign exchange
rates from Koruna to other currencies. It does not support global
currency exchange rates and visualizations like fxtrackerR
does.
You can install the development version of fxtrackerR from GitHub with:
install.packages("devtools")
devtools::install_github("UBC-MDS/fxtrackerR")This is a basic example which shows you how to solve a common problem:
library(fxtrackerR)fx_conversion('EUR', 'USD', 150.75)
163.68
fx_rate_lookup('EURUSD', 1.072)
‘2023-01-10’
price_trend_viz('EURUSD', '2018-12-01', '2022-12-01', 'high')

If a line chart is specified in the input:
pl_trend_viz("EURUSD", "2020-01-01", "2022-01-01", 'line')

If an area chart is specified in the input:
pl_trend_viz("EURUSD", "2020-01-01", "2022-01-01", 'area')
