I have the following xts matrix:
> options(digits.secs = 6)
> set.seed(1234)
> xts(1:10, as.POSIXlt(1366039619, tz="EST", origin="1970-01-01") + rnorm(10, 500000, 250000)/1000000)
[,1]
2013-04-15 10:26:58.913576 4
2013-04-15 10:26:59.198234 1
2013-04-15 10:26:59.277491 10
2013-04-15 10:26:59.356315 7
2013-04-15 10:26:59.358887 9
2013-04-15 10:26:59.363342 8
2013-04-15 10:26:59.569357 2
2013-04-15 10:26:59.607281 5
2013-04-15 10:26:59.626514 6
2013-04-15 10:26:59.771110 3
Warning message:
timezone of object (EST) is different than current timezone ().
I need to generate time series records every 100 milliseconds having the last value for this period. For instance:
[,1]
2013-04-15 10:26:58.000000 4
2013-04-15 10:26:59.100000 4
2013-04-15 10:26:59.200000 1
2013-04-15 10:26:59.300000 10
2013-04-15 10:26:59.400000 8
...
Notice how the last record contains 8, that is, the last record for a period from 30000 to 0.99999.
source
share