[R] zoo, zooreg, & ISOdatetime

David James djames at frontierassoc.com
Sat Aug 27 02:09:05 CEST 2005


I create a zooreg object that runs from Jan-1-2002 0:00 to Jun-1-2005  
0:00...

regts.start = ISOdatetime(2002, 1, 1, hour=0, min=0, sec=0, tz="")
regts.end = ISOdatetime(2005, 6, 1, hour=0, min=0, sec=0, tz="")
regts.zoo <- zooreg( NA, regts.start, regts.end, deltat=3600 )

Upon inspection:
 > regts.zoo[1:3]
2002-01-01 00:00:00 2002-01-01 01:00:00 2002-01-01 02:00:00
                  NA                  NA                  NA

 > regts.zoo[29926:29928]
2005-05-31 22:00:00 2005-05-31 23:00:00 2005-06-01 00:00:00
                  NA                  NA                  NA

However:
 > summary(regts.zoo)
Error in "row.names<-.data.frame"(`*tmp*`, value = c("2002-01-01  
00:00:00",  :
     duplicate 'row.names' are not allowed

I don't understand why it claims that there are duplicate row.names.   
Any advice?

I probably could use the aggregate function to clean this up, but I  
don't see why it should be needed (provided that I do things properly  
in the first place).

Thanks,
David




More information about the R-help mailing list