Re: [R] how to resample (or resize) matrix?

From: Gabor Grothendieck <ggrothendieck_at_gmail.com>
Date: Thu 27 Jul 2006 - 20:54:44 EST

Assuming the problem is to partition the 10x10 matrix x into 25 two by two squares and then average each of those squares, try this:

   apply(array(x, c(2,5,2,5)), c(2,4), mean)

On 7/27/06, Vladimir Eremeev <wl@eimb.ru> wrote:
> Dear r-help,
>
> I have a matrix, suppose, 10x10, and I need the matrix 5x5, having
> in each cell a mean value of the cells from the initial matrix.
>
> Please, point me to a function in R, which can help me doing that.
>
> Digging the documentation and mail archives didn't give me a result.
>
> Thank you.
>
> ---
> Best regards,
> Vladimir mailto:wl@eimb.ru
>
> ______________________________________________
> R-help@stat.math.ethz.ch 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.
>



R-help@stat.math.ethz.ch 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. Received on Thu Jul 27 21:02:38 2006

Archive maintained by Robert King, hosted by the discipline of statistics at the University of Newcastle, Australia.
Archive generated by hypermail 2.1.8, at Thu 27 Jul 2006 - 22:17:40 EST.

Mailing list information is available at https://stat.ethz.ch/mailman/listinfo/r-help. Please read the posting guide before posting to the list.