Dear all,

I have a data frame of 2160 rows and 4320 columns, which I hope to condense to 
a smaller dataset by finding averages of 6 by 6 blocks of values (to produce a 
data frame of 360 rows by 720 columns).

How would I go about finding the mean of a 6 x 6 block, then find the mean of 
the next adjacent 6 x 6 block, and so on, until the whole data frame has been 
covered?

One slight twist is that I have NA values, which I don't want to be included in 
the calculations unless a particular 6 x 6 block is entirely composed of NA 
values - in which case, NA should be the output value.

Thanks very much for any advice and solutions.

Steve

_________________________________________________________________
Get Hotmail on your mobile from Vodafone 

______________________________________________
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