Assuming in R, I have a data.frame with the first column representing the time (as POSIXct). The rest of the columns (e.g., columns 2) are numeric data.
I would like to group time into 3-minute intervals. Each interval will the the average of values that falls into that particular interval.
Right now, I have a for-loop that iterates through the time column and generate the interval on the fly. I am wondering if there’s a more elegant way to accomplish the same thing?
Thanks in advance.
Derek
I think that a command like the following, would return a list of the values that fall into 3 minute intervals. (
vis the name of the dataframe anddatecolis the name of the date column)