Определенно не просто, но это работает.
a = array(1:(126*59*240),c(126,59,240)) # Dummy data
s = seq(1,240,by=12) # Sequence of cutpoints for 3rd dim
aux =lapply(s,function(x){
apply(a[,,x:(x+11)],c(1,2),mean,na.rm=TRUE) # Get list with mean per each 12 3rd dim
})
aux2 = do.call(cbind,aux) # Bind all elements of list by column
Y = array(aux2,dim=c(dim(aux[[1]]),length(aux))) # Reconvert into array
> dim(Y)
[1] 126 59 20