Is there a simple and nice answer to this question?
I have a given list "l" of matrices (with same ncol & nrow).
do.call(.Primitive("+"),l) / length(l)
Here are some alternatives:
Reduce("+", l) / length(l)
2) simlify2array/apply A bit longer than (1); however, it does have the advadntage of readily extending to functions other than
apply(simplify2array(l), 1:2, mean)
3) tapply Not as simple but like (2) it extends to functions other than
array(tapply(unlist(l), sequence(sapply(l, length)), mean), dim(l[]))
array(rowMeans(matrix(unlist(l), length(l[]))), dim(l[]))