Turning here since I haven't been able to find any help online.
I'm currently dealing with a high-frequency data set in R of some stock indicies and I'm currently trying to clean the data so that I will be able to work with it.
So, to get to the problem, I'm trying to incorporate the overnight returns of the indicies (i.e. prices in between 15:00 and 09:00 the following day) as done by Hansen & Lunde (2005) - that is, taking the median of the overnight prices and storing it as the 09:00 observation the next day.
Does anyone have any R-code on how to deal with this problem?
PS. I have been able to store the overnight median price as the 23:00-observation the previous day (i.e. the day that the overnight trading started). However, I haven't been able to change the date and time of these observations so that they end up at 09:00 the next day. An example is listed below:
2006-12-29 14:30:00 17320.00 2006-12-29 14:35:00 17315.00 2006-12-29 14:40:00 17315.00 2006-12-29 14:45:00 17322.50 2006-12-29 15:00:00 17325.00 2006-12-29 23:00:00 17321.25 <- THIS OBSERVATION I WOULD LIKE TO END UP AT 09:00 THE NEXT DAY