O'Reilly logo

Mastering Predictive Analytics with R by Rui Miguel Forte

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

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 ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required