Skip to content
Prev 361745 / 398506 Next

Find mean of values in three-dimensional array

Dunno about fast, but the canonical way is apply(A, c(1,2), mean)

E.g.

(A <- array(1:24,c(2,3,4)))
apply(A, c(1,2), mean)
apply(A, c(1,3), mean)

-pd