Skip to content
Prev 172045 / 398503 Next

Large 3d array manipulation

On 27/02/2009 6:15 PM, Vemuri, Aparna wrote:
Yes, vectorize it.  I think this would work:

newVar <- array(NA, c(243, 246, 768))

for (k in 1:768)
   newVar[,,k] <- apply(myVar, 1:2, function(x) mean(x[k:(k+7)]))

but of course I haven't tried it.

Duncan Murdoch