[R] aggregate function

Michel Schnitz michel.schnitz at web.de
Mon Apr 23 12:51:18 CEST 2007


Hello,

is there a way to use the aggregate function to calculate monthly mean 
in case i have one row in data frame that holds the date like 
yyyy-mm-dd? i know that it works for daily means. i also like to do it 
for monthly and yearly means. maybe there is something like aggregate(x, 
list(Date[%m]), mean)?
the data frame looks like:

Date		Time	z
2006-01-01	21:00	6,2
2006-01-01	22:00	5,7
2006-01-01	23:00	3,2
2006-01-02	00:00	7,8
2006-01-02	01:00	6,8
2006-01-02	02:00	5,6
.
.
.
2007-03-30	22:00	5,2
2007-03-30	23:00	8,3
2007-03-31	00:00	6,4
2007-03-31	01:00	7,4

thanks for help!
-- 
Michél Schnitz
michel.schnitz at web.de



More information about the R-help mailing list