[R-SIG-Finance] Split-adjusted yahoo data

Dirk Eddelbuettel edd at debian.org
Sat Mar 15 04:32:56 CET 2014


Ralph,


On 14 March 2014 at 23:21, R Vince wrote:
| I know this has been asked many times before, but for the life of me I
| cannot find the answer in my notes. How do I get the column for
| split-adjusted data from yahoo finance? The script I use to download the
| data is:

Maybe use a different script?

R> library(quantmod)
Loading required package: Defaults
Loading required package: xts
Loading required package: zoo

Attaching package: ‘zoo’

The following objects are masked from ‘package:base’:

    as.Date, as.Date.numeric

Loading required package: TTR
Version 0.4-0 included new data defaults. See ?getSymbols.
R> IBM <- getSymbols("IBM", auto.assign=FALSE)
R> head(IBM)
           IBM.Open IBM.High IBM.Low IBM.Close IBM.Volume IBM.Adjusted
2007-01-03    97.18    98.40   96.26     97.27    9196800        85.57
2007-01-04    97.25    98.79   96.88     98.31   10524500        86.48
2007-01-05    97.60    97.95   96.91     97.42    7221300        85.70
2007-01-08    98.50    99.50   98.35     98.90   10340000        87.00
2007-01-09    99.08   100.33   99.07    100.07   11108200        88.03
2007-01-10    98.50    99.05   97.93     98.89    8744800        86.99
R> tail(IBM)
           IBM.Open IBM.High IBM.Low IBM.Close IBM.Volume IBM.Adjusted
2014-03-07   188.35   188.92  187.18    187.68    4117800       187.68
2014-03-10   187.55   188.37  185.85    186.39    4591200       186.39
2014-03-11   187.41   188.45  186.04    186.76    4229500       186.76
2014-03-12   186.01   187.45  185.89    186.22    4833000       186.22
2014-03-13   186.41   187.00  183.71    183.90    4912600       183.90
2014-03-14   183.89   184.29  182.21    182.21    5479700       182.21
R> 

Dirk

-- 
Dirk Eddelbuettel | edd at debian.org | http://dirk.eddelbuettel.com



More information about the R-SIG-Finance mailing list