I would like to generate a 1 min spaced time sequence to paste then to a xts object. Basically, I've got a tick-by-tick dateTime object like that :
[1] "2010-02-02 08:00:03 CET" "2010-02-02 08:00:04 CET" "2010-02-02 08:00:04 CET" "2010-02-02 08:00:04 CET" "2010-02-02 08:00:04 CET"
[6] "2010-02-02 08:00:04 CET" "2010-02-02 08:00:04 CET" "2010-02-02 08:00:05 CET" "2010-02-02 08:00:05 CET" "2010-02-02 08:00:05 CET"
I'm aggregating my xts series (by previous tick) to get a 1 min (equally)-spaced time series using an RTAQ package function :
price_1m<-aggregatets(price,FUN="previoustick",k=1,on="minutes")
The problem is that the time label is not aggregated that is the aggregated series is not labeled by a 1 min spaced time-object. This is due is part to the fact that there are seconds with no prices. To get a equally spaced time series, the functions fills the blanks with the previous tick price.
Thus, how can i create a 1 min spaced time sequence to get an artificial 1 min spaced time sequence?
Thanks.