Possible Duplicate:
XTS apply function to time of day subset?
I'm interested in this kind of pattern: does something interesting happen each day between 09:45 and 09:55 [regardless if it's this day or the other]. I'm using xts, but I can't find a way to disregard the date, and use only the time for this analysis.
Here's some code as an example:
times = c(as.POSIXct("2012-11-03 09:45:00 IST"),
as.POSIXct("2012-11-04 09:45:00 IST"),
as.POSIXct("2012-11-05 12:45:00 IST"),
as.POSIXct("2012-11-08 09:45:01 IST"))
xts.obj = xts(c(1,2,3,4),order.by = times)
#the resulting xts object:
#2012-11-03 09:45:00 1
#2012-11-04 09:45:00 2
#2012-11-05 12:45:00 3
#2012-11-08 09:45:01 4
My aim is to be able to aggregate e.g. (09:45-09:55), regardless of day. this would result in entries (1,2,4): they all take place in this time range [on different dates]
Thanks a lot.