Skip to content
Prev 6117 / 15274 Next

Replacing zoo time series values

Try

library(fImport)
library(zoo)
SPyf<-yahooSeries("^GSPC", file="SPyahoo.csv", frequency="daily", nDaysBack=400)
z <- as.zoo(SPyf)
z[,1] <- (z[,2]+z[,3])/2
colnames(z)[1]  <- "hilo"

See the three vignettes that come with zoo for many examples.  In
particular, vignette("zoo-quickref") illustrates the use of the
tseries package to read a series from yahoo directly into a zoo
object.  Also see the related quantmod and xts packages.
On Wed, May 12, 2010 at 4:33 AM, Research <risk2009 at ath.forthnet.gr> wrote: