On Oct 7, 2011, at 2:45 AM, Petr PIKAL wrote:

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

The details of datA entry may need to be fleshed out. MORE SPEFIC ADVICE


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?

Perhaps:

colMeans( dat[ , c("JAN", "DEC", "FEB")] )

--

David Winsemius, MD
West Hartford, CT

______________________________________________
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