I try am trying to use the “to.minutes3” function in the xts package to segment my data.
This function does correctly put the time column into the desired intervals. But data columns becomes “open” , “close”, “high” and “low”. Is there are way tell the function to average the data points that fall into the same interval?
Thanks,
Derek
You want
period.apply. Assuming your data are in objectxand are more frequent than 3-minutes, the code below will give you a mean for each distinct, non-overlapping, 3-minute interval.