I think there is a bug somewhere in getSymbols.yahoo, but I haven't quite
tracked it down.

#First, an example of it working
getSymbols('SPY', to='2011-01-01')
SPY.adj <- adjustOHLC(SPY)
head(SPY.adj) #as expected

#Now, try again with earlier 'to' date
getSymbols('SPY', to='2010-01-01')
SPY.adj <- adjustOHLC(SPY)
head(SPY.adj) #NA for Op,Hi,Lo,Cl

# Try to do, "by hand," the same thing
# that getSymbols.yahoo does
getSymbols('SPY', to='2010-01-01')
div <- getDividends('SPY',to='2010-01-01')
spl <- getSplits('SPY',to='2010-01-01')

adj <- na.omit(adjRatios(spl, div, Cl(SPY)))
#head(adj); tail(adj)

fr <- SPY
fr[,1] <- fr[,1] * adj[, "Split"] * adj[, "Div"]
fr[,2] <- fr[,2] * adj[, "Split"] * adj[, "Div"]
fr[,3] <- fr[,3] * adj[, "Split"] * adj[, "Div"]
fr[,4] <- fr[,4] * adj[, "Split"] * adj[, "Div"]
fr[,5] <- fr[,5] * (1/adj[, "Div"])

head(fr) #Why did that work?

########### End code

R> sessionInfo()
R version 2.13.0 (2011-04-13)
Platform: x86_64-pc-linux-gnu (64-bit)

locale:
 [1] LC_CTYPE=en_US.UTF-8       LC_NUMERIC=C
LC_TIME=en_US.UTF-8        LC_COLLATE=en_US.UTF-8
 [5] LC_MONETARY=C              LC_MESSAGES=en_US.UTF-8
 LC_PAPER=en_US.UTF-8       LC_NAME=C
 [9] LC_ADDRESS=C               LC_TELEPHONE=C
LC_MEASUREMENT=en_US.UTF-8 LC_IDENTIFICATION=C

attached base packages:
[1] stats     graphics  grDevices utils     datasets  methods   base

other attached packages:
[1] quantmod_0.3-15 TTR_0.20-3      xts_0.8-0       zoo_1.6-4
Defaults_1.1-1

loaded via a namespace (and not attached):
[1] grid_2.13.0     lattice_0.19-26

	[[alternative HTML version deleted]]

