I don't believe that there's any way to do this built into zoo or chron, but you can create your own function by using a little math. Here you go:
trunc.minutes <- function (x, n.minutes)
{
if (!inherits(x, "times"))
x <- as.chron(x)
x <- as.numeric(x)
sec <- round(24 * 3600 * abs(x - floor(x)))
h <- (sec%/%(n.minutes*60))/(60/n.minutes)
hour <- as.integer(h)
minutes <- (h %% hour) * 60
chron(dates=chron::dates(x), times=times(paste(hour, minutes, "00", sep=":")))
}
Here's an example of the usage:
dts <- chron::dates(c("02/27/92", "02/27/92", "01/14/92",
"02/28/92", "02/01/92"))
tms <- times(c("23:03:20", "23:29:56", "01:03:30",
"18:21:03", "16:56:26"))
x <- chron(dates = dts, times = tms) # original dates
x
[1] (02/27/92 23:03:20) (02/27/92 22:29:56) (01/14/92 01:03:30)
[4] (02/28/92 18:21:03) (02/01/92 16:56:26)
trunc.minutes(x, 15) # new dates at 15 minute intervals
[1] (02/27/92 23:00:00) (02/27/92 22:15:00) (01/14/92 01:00:00)
[4] (02/28/92 18:15:00) (02/01/92 16:45:00)
trunc.minutes(x, 30) # new dates at 30 minute intervals
[1] (02/27/92 23:00:00) (02/27/92 22:00:00) (01/14/92 01:00:00)
[4] (02/28/92 18:00:00) (02/01/92 16:30:00)
Lastly, you can now use this function to aggregate the data:
ts.zoo <- zoo(rnorm(5), x) # a zoo time series
Or just use these new dates for aggregation (see how it rolls up the second example since there are two values in that window):
> aggregate(ts.zoo, trunc.minutes(x, 15), mean)
(01/14/92 01:00:00) (02/01/92 16:45:00) (02/27/92 23:00:00) (02/27/92 23:15:00)
-0.6738659 -0.4844803 0.7968155 -1.3571121
(02/28/92 18:15:00)
0.7625861
> aggregate(ts.zoo, trunc.minutes(x, 30), mean)
(01/14/92 01:00:00) (02/01/92 16:30:00) (02/27/92 23:00:00) (02/28/92 18:00:00)
-0.6738659 -0.4844803 -0.2801483 0.7625861