I am currently using split.xts in the form of split(xts.obj,'days') to create lists of intra-day data, so that each element of the list represents one day. This breaks up a day from midnight to (just before) midnight the next day is there a way to split up the data into the lists at an arbitrary time, e.g. say 9am till 08:59.59.999am the next day?
It’s a reasonably generic question but if you want sample data…here it is…The below should illustrate my point about the split occurring at midnight.
require(xts)
x <- xts(rnorm(1000000),Sys.time()-1000000:1)
x1 <- split(x,'days')
head(x1[[2]])
EDIT:
The solution is very similar to one produced as the answer to this question… How do I extract / subset day+0 to day+1 index times from minutely data via xts in R?, but if there is a more direct way of doing it that would be appreciated…
This creates a vector of times (for GMT 9AM):