I'm trying to use xtable for 3-dimensional array. My minimal example is
Test <- 
structure(1:8, .Dim = c(2L, 2L, 2L), .Dimnames = list(c("A1", 
"A2"), c("B1", "B2"), c("C1", "C2")))
library(plyr)
library(xtable)
a_ply(.data=Test, .margins=3, function(i) {
  xtable(x = Test[, , i])
      }
)
This produces the following error:
  Error in xtable(x = Test[, , i]) : subscript out of bounds
I'd appreciate if you give me some pointers to resolve this problem. Thanks in advance.
 
     
     
    