Skip to content
Prev 273445 / 398506 Next

mean of 3D arrays

On Oct 5, 2011, at 8:14 AM, R. Michael Weylandt <michael.weylandt at gmail.com
> wrote:

            
pmean <- function(lis) Reduce("+",lis)/length(lis)

res <- pmean( list(x1,x2,x3) )

 > str(res)
  num [1:10, 1:10, 1:10] -0.879 0.843 -2.184 1.33 -0.675 ...