Let\'s say I have a 3-dimensional array:
a <- array(dim = c(3, 2, 2))
and a vector with indices for the 1st dimension:
ind