Re: [R] Irregular Time Series Issue

2008-03-07 Thread Gabor Grothendieck
I noticed a problem with the merging factors so try using character variables instead: library(zoo) Lines <- "Time Data Time1 Data1 1 b1 e 7 g 4i NA NA 5 k NA NA NA NA " DF <- read.table(textConnection(Lines), header = TRUE, as.i

Re: [R] Irregular Time Series Issue

2008-03-07 Thread Gabor Grothendieck
The following reads in the series as a data frame and then na.omit's the NA's and converts to zoo. Optionally we can merge them back together aligning them on the times. library(zoo) Lines <- "Time Data Time1 Data1 1 b1 e 7 g 4i NA NA 5 k N

Re: [R] Irregular Time Series Issue

2008-03-07 Thread Spencer Graves
Have you considered using 'corCAR1' with 'lme' in the 'nlme' package? Hope this helps. Spencer Graves p.s. If you are not familiar with this, I highly recommend Pinheiro, J.C., and Bates, D.M. (2000) Mixed-Effects Models in S and S-PLUS (Springer). The "~R\library\nlme\scr