I am having a problem when converting irregular time series to regular time series. Below a simplified example can be found:
require(zoo)
t <- as.characte
It's not a bug. There are 1,461 days spanning the 4 years in your time series. And it doesn't work for me the first time I run it. as.Date(t,"%Y")
doesn't know what month/day to use to make a date, so it uses today's month/day. That does not make for reproducible analysis. Try this instead:
t <- c(1981,1984,1985)
d <- c(1,3,6)
z <- zoo(d,t)
z <- merge(z,zoo(,c(1981,1982,1983,1984,1985)))
ts.d <- as.ts(z)
Which yields:
> ts.d
Time Series:
Start = 1981
End = 1985
Frequency = 1
[1] 1 NA NA 3 6