TITLE(aperm @@ Array Transposition)
USAGE(
aperm(a, perm, resize=TRUE)
)
ALIAS(aperm)
ARGUMENTS(
ARG(a @@ the array to be transposed.)
ARG(perm @@ the subscript permutation vector.)
ARG(resize @@ a flag indicating whether the vector
should be resized as well as having its elements reordered
(default LANG(TRUE).)))
VALUE(
A transposed version of array LANG(a), with subscripts permuted as
indicated by the array LANG(perm).  If LANG(resize) is LANG(TRUE), the
matrix is reshaped as well as having its elements permuted.
PARA
The function LANG(t) provides a faster and more convenient
way of transposing matrices.
)
SEEALSO(
LANG(LINK(t)).
)
EXAMPLES(
# interchange the first two subscripts on a 3-way array x
x  <- array(1:24, 2:4)
xt <- aperm(x, c(2,1,3))
all( t(xt[,,2]) == x[,,2] )
)
