Skip to content
Back to formatted view

Raw Message

Message-ID: <5E6A2740-10A7-4CED-9B41-32A109317325@googlemail.com>
Date: 2011-10-05T13:00:31Z
From: Martin Batholdy
Subject: mean of 3D arrays

Hi,

I have multiple three dimensional arrays.

Like this:

x1 <- array(rnorm(1000, 1, 2), dim=c(10, 10, 10))
x2 <- array(rnorm(1000, 1, 2), dim=c(10, 10, 10))
x3 <- array(rnorm(1000, 1, 2), dim=c(10, 10, 10))


Now I would like to compute the mean for each corresponding cell.
As a result I want to get one 3D array (10 x 10 x 10) in which at position x, y, z is the mean of the corresponding values of x1, x2 and x3 (at position x, y, z).


How can I do this?