[R] Mean(s) from values in different row?

Petr PIKAL petr.pikal at precheza.cz
Fri Oct 7 08:45:54 CEST 2011


Hi

> 
> Hello:
> 
> Is there a way to get a mean from values stored in different rows? 
> 
> The data looks like this:
>   YEAR-1, JAN, FEB, ..., DEC
>   YEAR-2, JAN, FEB, ..., DEC
>   YEAR-3, JAN, FEB, ..., DEC
> 
> What I want is the mean(s) for just the consecutive winter months:
>   YEAR-1.DEC, YEAR-2.JAN, YEAR-2.FEB
>   YEAR-2.DEC, YEAR-3.JAN, YEAR-3.FEB
>   etc.

Isn't colMean(yourdata) what you want?

Regards
Petr

> 
> Thanks.
> 
> ______________________________________________
> R-help at 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.



More information about the R-help mailing list