Aggregate by week in R Aggregate by week in R r r

Aggregate by week in R


The easiest thing to do is to use the apply.weekly function from xts.

> apply.weekly(zoo(1:10, as.Date("2010-01-01") + 1:10), mean)2010-01-03 2010-01-10 2010-01-11          3         42         10