Predicting foreign exchange rates
Our third and final data set will be constructed from a historical database of Euro Foreign Exchange Reference rates provided by the website of the European Central Bank. We can download a zipped archive containing the data from http://www.ecb.europa.eu/stats/eurofxref/eurofxref-hist.zip. When unzipped, this archive contains a file titled eurofxref-hist.csv
, which we can directly import into R using the read.csv()
function:
> eurofxref.hist <- read.csv("eurofxref-hist.csv", stringsAsFactors = F) > eurofxref.hist[1 : 6, 1 : 6] Date USD JPY BGN CYP CZK 1 2014-09-05 1.2948 136.27 1.9558 N/A 27.596 2 2014-09-04 1.3015 136.89 1.9558 N/A 27.662 3 2014-09-03 1.3151 138.11 1.9558 N/A 27.658 4 2014-09-02 1.3115 137.63 1.9558 ...
Get Mastering Predictive Analytics with R now with the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.