I have a long time series (zoo) of precipitation data, I know how to obtain the monthly average of the values:
library(hydroTSM)
ma= monthlyfunction(data, mean, na.rm=TRUE)
I also know how to obtain the monthly sum of the values:
su= monthlyfunction(data, sum, na.rm=TRUE)
but with the last one I get a monthly sum for the whole period of the time serie. I would like to get a monthly average of the sums, I mean for example:
jan 1980 (sum)= 150
jan 1981 (sum)= 180
jan 1982 (sum)= 90
expected value for january = average(150,180,90)= 140
Is there a function for this instead of mean and sum?