0

I get an issue when trying to define a zoo object based on a POSIXlt vector containing a DST (Daylight Saving Time). Having a look at the source code of zoo() function, you can see that the warning arise from the behavior of match() that does not take into account the time zone of the POSIXlt.

Any solution ?

library(zoo)

order.by <- seq(ISOdatetime(2004,10,31,0,0,0,tz = "Europe/Paris"),
                ISOdatetime(2004,10,31,6,0,0,tz = "Europe/Paris"),
                by=3600)


zoo(1:8, order.by) # no warning

zoo(1:8, as.POSIXlt(order.by)) # warning

Warning message:
In zoo(1:8, as.POSIXlt(order.by)) :
  some methods for “zoo” objects do not work if the index entries in ‘order.by’ are not unique

Thanks,

Jérémy

jlesuffleur
  • 1,113
  • 1
  • 7
  • 19
  • it works OK for `as.POSIXct` ... – Ben Bolker Apr 10 '15 at 15:34
  • Indeed, but it should not rise a warning for a POSIXlt, right ? – jlesuffleur Apr 10 '15 at 15:56
  • @jlesuffleur, zoo does not handle a fixed set of index classes but handles any class that satisfies certain properties -- if you consider what would have to be done to make such a check it becomes quickly clear that its not feasible to check whether the class satisfies those or not. I don't think POSIXlt satisfies zoo's requirements so use POSIXct instead (as already suggested by Ben Bolker). – G. Grothendieck Apr 10 '15 at 16:45

0 Answers0