www-ai.cs.tu-dortmund.de/LEHRE/VORLESUNGEN/KDD/SS12/FOLIEN/R-intro.pdf
previous example, a[2,,] is a 4× 2 array with dimension vector c(4,2) and data vector containing the values
c(a[2,1,1], a[2,2,1], a[2,3,1], a[2,4,1], a[2,1,2], a[2,2,2], a[2,3,2], a[2,4,2])
in that order. [...] function(y1, y2) { n1 <- length(y1); n2 <- length(y2) yb1 <- mean(y1); yb2 <- mean(y2) s1 <- var(y1); s2 <- var(y2) s <- ((n1-1)*s1 + (n2-1)*s2)/(n1+n2-2) tst <- (yb1 - yb2)/sqrt(s*(1/n1 + 1/n2)) tst
}
With [...] [,1] [,2] [,3] [,4] [,5] [1,] 1 5 9 13 17 [2,] 2 6 10 14 18 [3,] 3 7 11 15 19 [4,] 4 8 12 16 20 > i <- array(c(1:3,3:1), dim=c(3,2)) > i # i is a 3 by 2 index array.
[,1] [,2] [1,] 1 3 [2,] 2 2 [3,] 3 …