Skip to content
Prev 371386 / 398506 Next

require help

Second try to do what you would like (I hope and think)
Using Eric's sample data

<code>
zdf <- data.frame(year=2001:2010, cnsm=sample(170:180,10,replace=TRUE),
                 incm=rnorm(10,53,1), wlth=rnorm(10,60,1))
zdf

# R ts
zts <- ts(zdf[,-1], start=zdf[1,"year"])
zts

# turn data into a zoo timeseries and an xts timeseries

library(zoo)
z.zoo <- as.zoo(zts)
z.zoo

library(xts)
z.xts <- as.xts(zts)
z.xts
</code>

Berend Hasselman