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 O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.