> # create sequence for 'cut'
> > cSeq <- seq(tMin, max(x$V1) + (7.5 * 60), by = '15 min')
> > # now split and average
> > cCut <- cut(x$V1, cSeq)
> > # compute means
> > tapply(x$V2, cCut, mean)
> 2012-07-22 11:52:30 2012-07-22 12:07:30 2
Hi,
I'm pretty new to R and have run into a task which although I'm certain is
within R's capabilities, falls outside of mine. :-) Consider the following
data set:
2012-07-22 12:12:00, 21
2012-07-22 12:15:00, 22
2012-07-22 12:18:00, 24
2012-07-22 12:39:00, 21
2012-07-22 12:45:00, 25
2012-07-22 12
2 matches
Mail list logo