June 2016
Beginner to intermediate
1783 pages
71h 22m
English
Given R's powerful analysis and graphical capabilities, it is no surprise that R is very popular in the world of finance. In this recipe, we will learn how to plot data from the stock market using some special libraries.
We need the tseries and quantmod packages to run the following recipes. Let's install and load these two packages:
install.packages("quantmod")
install.packages("tseries")
library(quantmod)
library(tseries)Let's first see an example using the tseries library function, get.hist.quotes(). We will compare the stock prices of three technology companies:
aapl<-get.hist.quote(instrument = "aapl", quote = c("Cl", "Vol")) goog <- get.hist.quote(instrument = "goog", quote = c("Cl", "Vol")) ...Read now
Unlock full access