gperm | R Documentation |
Permute and collapse the dimensions of an array
gperm(x, perm)
x |
an array. |
perm |
the subscript permutation list. |
Like aperm
this function permutes the dimensions of an
array, but can also collapse adjacent dimensions. The permutation
of dimensions is specified by a list of vectors. The index of
each dimension must appear exactly once, but dimensions that occur
together in a vector are reduced to a single dimension.
The redimensioned array.
x <- array(1:120,2:5) dim(gperm(x,list(4,3,2,1))) dim(gperm(x,list(c(4,3),2,1))) dim(gperm(x,list(1,c(3,2),4)))
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.