如果我们有三年的数据:
数据= (x1:x1096)
我想以这种方式计算平均值:
[x1+x366(the first day in the second year)+ x731(the first day in the third year)]/3
[x2+x367(the second day in the second year)+ x732(the second day in the third year)]/3
依此类推,直到第 365 天:
[x365+x730(the last day in the second year)+ x1096(the last day in the third year)]/3
最后我会365 values
摆脱它。
dat= c(1:1096)
关于如何做到这一点的任何想法?