[R] TS: Calculating the mean by month

Victor vdemart at gmail.com
Tue Feb 18 09:47:46 CET 2014


I have the following (monthly) ts time-series:
> t
      Jan  Feb  Mar  Apr  May  Jun  Jul  Aug  Sep  Oct  Nov  Dec
2002  5.3  9.4 12.1 14.4 17.9 23.5 24.3 23.6 19.3 16.3 13.9  9.0
2003  7.5  5.4 10.4 13.3 19.9 25.6 26.2 27.6 20.6 15.5 12.5  8.0
2004  6.3  7.8  9.6 13.6 16.5 22.0 24.3 24.6 21.3 18.1 11.7  9.0
2005  5.7  5.4  9.7 13.0 18.9 22.9 25.0 23.4 21.4 16.5 11.3  6.7

I would like to calculate the mean of data by month.

How can I do it with a ts time series?

Many thanks
Vittorio



More information about the R-help mailing list