aperm(a, perm, resize=true)
a
| the array to be transposed. |
perm
| the subscript permutation vector. |
resize
|
a flag indicating whether the vector
should be resized as well as having its elements reordered
(default true.)
|
aperm transposes the array a, permuting subscripts as
indicated by the array perm. If resize is true, the
matrix is reshaped as well as having its elements permuted.
The function t provides a faster and more convenient
way of transposing matrices.
See Also
t.
Examples
# interchange the first two subscripts
# on a 3-way array x
xt <- aperm(x, c(2,1,3))