I'm using R to aggregate tick data and I have the following function which works well to aggregate the data to the minute but now I want to expound on that and aggregate to 5, 10, 15min. How can I do that?
SPY <- aggregate(as.numeric(SPY$PRICE), list(min = cut(index(SPY), breaks="min")), mean)