Если у меня есть этот массив:
vector1 <- c(5,9,3)
vector2 <- c(10,11,12,13,14,15)
result <- array(c(vector1,vector2,vector1,vector2,vector1,vector2,vector1,vector2,vector1,vector2,vector1,vector2),dim = c(3,3,12))
str(result)
num [1:3, 1:3, 1:12] 5 9 3 10 11 12 13 14 15 5 ...
Мне нужно начать с [,, 4] и считать 3, поэтому у меня будет
[,,4] [,,5] [,,6] and then compute the mean for them
[,,7] [,,8] [,,9] and then compute the mean for them
[,,10] [,,11] [,,12] and then compute the mean for them