如何计算R中列表中存储的数组的平均值?结果应该是包含平均值的相同大小的数组......例如:R中的3D数组列表的平均值
a1 <- array(runif(100), dim=c(4, 5, 5))
a2 <- array(runif(100), dim=c(4, 5, 5))
a3 <- array(runif(100), dim=c(4, 5, 5))
a4 <- array(runif(100), dim=c(4, 5, 5))
a5 <- array(runif(100), dim=c(4, 5, 5))
l <- list(a1, a2, a3, a4, a5)
[...]
应该产生包含平均值的维数4,5,5的数组。
我可以做它矩阵列表:
apply(simplify2array(myList), 1:2, mean)
,但它并不适用于我的目的工作...
感谢您的任何线索!
谢谢,它的工作完美,非常快! – Marc