Get Share Prices from Yahoo and plot as zoo Time Series


This gets the S&P 500 time series from Yahoo using the tseries package function get.hist.quote which returns a zoo object. As we’re using ggplot2 we have to convert the zoo series into a data frame.

Alternatively if you don’t want to use ggplot2 the old-school plot function works just fine, but doesn’t look as good.