Dear list users,
I have a data frame as below specified.
From the 1st of May to the 30th of September of several years (e.g. from 2004 
to 2011) I have a frequency of accidents.
I need the mean of accidents divided by weeks (i.e. the mean of accidents from 
the 1st to the 7th of May of all the years, from the 8th to the 14th of May,
..., from the 29th to the 31st of May, from the 1st to the 7th of July and so 
on).
Is there an easy way to do that?

Thank you for your help
Stefano Sofia


          year    month    day Freq
1       2004             5        1       3
2       2004             5     10       2
3       2004             5     11       2
4       2004             5     12       2
5       2004             5     13       3
6       2004             5     14       0
7       2004             5     15       2
8       2004             5     16       1
9       2004             5     17       6
10     2004            5     18       1
11     2004            5     19       2
12     2004            5       2       4
13     2004            5     20       0
14     2004            5     21       0
15     2004            5     22       3
16     2004            5     23       4
17     2004            5     24       3
18     2004            5     25       2
19     2004            5     26       2
20     2004            5     27       0
21     2004            5     28       2
22     2004            5     29       3
23     2004            5       3       2
24     2004            5     30       3
25     2004            5     31       7
26     2004            5       4       1
27     2004            5       5       2
28     2004            5       6       3
29     2004            5       7       3
30     2004            5       8       1
31     2004            5       9       1
32     2004            6       1       3
33     2004            6     10       1
34     2004            6     11       3
35     2004            6     12       1
36     2004            6     13       3
37     2004            6     14       1
38     2004            6     15       1

AVVISO IMPORTANTE: Questo messaggio di posta elettronica può contenere 
informazioni confidenziali, pertanto è destinato solo a persone autorizzate 
alla ricezione. I messaggi di posta elettronica per i client di Regione Marche 
possono contenere informazioni confidenziali e con privilegi legali. Se non si 
è il destinatario specificato, non leggere, copiare, inoltrare o archiviare 
questo messaggio. Se si è ricevuto questo messaggio per errore, inoltrarlo al 
mittente ed eliminarlo completamente dal sistema del proprio computer. Ai sensi 
dell’art. 6 della  DGR n. 1394/2008 si segnala che, in caso di necessità ed 
urgenza, la risposta al presente messaggio di posta elettronica può essere 
visionata da persone estranee al destinatario.
IMPORTANT NOTICE: This e-mail message is intended to be received only by 
persons entitled to receive the confidential information it may contain. E-mail 
messages to clients of Regione Marche may contain information that is 
confidential and legally privileged. Please do not read, copy, forward, or 
store this message unless you are an intended recipient of it. If you have 
received this message in error, please forward it to the sender and delete it 
completely from your computer system.
______________________________________________
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.

Reply via email to