Dear Stefano,
A practical way might be as the following
R> acc<-read.table("acc.txt",header=T) #reading your data into R
R> acc.may<-acc[acc[,3]==5,] #subsetting data with respect to may
R> acc.may.order<-acc.may[order(acc.may[,4]),] #ordering with respect to day
R> mean(acc.may.order[1:7,5]) # m
Stefano,
On 13 April 2012 20:51, Stefano Sofia wrote:
> 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
>
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 year
3 matches
Mail list logo