reorder.array reorders an array along a specified
dimension according given names, indices or results of
a function applied.
Usage
## S3 method for class 'array'
reorder(x,dim=1,names=NULL,indices=NULL,FUN=mean,...)
## S3 method for class 'matrix'
reorder(x,dim=1,names=NULL,indices=NULL,FUN=mean,...)
Arguments
x
An array
dim
An integer specifying the dimension along which x should be ordered.
The result of rename(x,dim,names) is x
reordered such that dimnames(x)[[dim]] is equal to
the concatenation of those elements of names
that are in dimnames(x)[[dim]] and the remaining elements
of dimnames(x)[[dim]].
The result of rename(x,dim,indices) is x
reordered along dim according to indices.
The result of rename(x,dim,FUN) is x
reordered along dim according to order(apply(x,dim,FUN)).