.BG
.VE $Header: /usr3/s/current/s/.help/RCS/aperm,v 1.2 83/12/30 19:23:54 rab Exp $
.FN aperm
.TL
aperm: Array Permutations
.CS
aperm(a, perm)
.PP
.AG a
array to be permuted.  Missing values (NAs) are allowed.
.AG perm
vector containing a permutation of the integers 1:n where n
is the number of dimensions in the array `a'. The old dimension
given by `perm[j]' becomes the new `j'-th dimension.
.RT
array like `a', but with the observations permuted
according to `perm', e.g., if `perm' is `c(2,1,3)', the
result will be an array in which the old second dimension is
the new first dimension, etc.
.PP
If `a' contains a component `Label' (as in tables constructed with
the `table' function), it will also be permuted.
.EX
myiris <- aperm(iris,c(1,3,2))   # turns 50 x 4 x 3 to 50 x 3 x 4

myiris <- matrix(aperm(iris,c(1,3,2)),150,4)  # make 150 x 4 matrix
.KW multi*
.WR
