r - rollapply mean 5 previuous years -
i have zoo obj colled z.
> z["2013-12",1] allerona
2013-12-01 0.0 2013-12-02 0.0 2013-12-03 0.0 2013-12-04 0.0 2013-12-05 0.2 2013-12-06 0.0 2013-12-07 0.0 2013-12-08 0.2 2013-12-09 0.0 ....
it stores daily value of rainfall.
i'm able compute 5-days accumulation using rollapply usingi:
m=rollapply(z, width=3, fun=sum, by=1, by.column=true, fill=na, align="right")
it looks ok
> m["2013-12",1] allerona 2013-12-01 0.0 2013-12-02 0.0 2013-12-03 0.0 2013-12-04 0.0 2013-12-05 0.2 2013-12-06 0.2 2013-12-07 0.2 2013-12-08 0.2 2013-12-09 0.2 ...
how can calculate each day themean 5-years before?
thanks
sma (x, n=5*365)
does not trick ?
Comments
Post a Comment