For matrices, colMeans/rowMeans are quick, vectorized functions. But
say I have a higher dimensional array:
moo - array(runif(400*9*3),dim=c(400,9,3))
And I want to get the mean along the 2nd dimension. I can, of course,
use apply:
moo1 - apply(moo,c(1,3),mean)
But this is not a vectorized
] Vectorized version of colMeans/rowMeans for higher dimension
arrays?
For matrices, colMeans/rowMeans are quick, vectorized functions. But
say I have a higher dimensional array:
moo - array(runif(400*9*3),dim=c(400,9,3))
And I want to get the mean along the 2nd dimension. I can, of course,
use
2 matches
Mail list logo