| permute {seriation} | R Documentation |
A method for permuting
various classes including
the observations in a
dist object, the rows and columns of a matrix,
and all dimensions of an array given a suitable ser_permutation
object.
permute(x, order)
x |
an object (a list, a numeric vector, a dist object, a matrix,
an array or any other object which provides dim and standard
subsetting with "["). |
order |
an object of class ser_permutation
which contains suitable permutation vectors for x. |
The permutation vectors in ser_permutation
are suitable if the number of permutation vectors matches the number
of dimensions of x and if the length of each permutation vector
has the same length as the corresponding dimension of x.
For 1-dimensional/1-mode data (list, vector, dist),
order can also be a single
permutation vector of class ser_permutation_vector or data which can be
automatically coerced to this class
(e.g. a numeric vector).
ser_permutation,
dist in package stats.
m <- matrix(rnorm(10), 5, 2) m permute(m, ser_permutation(5:1, 2:1)) d <- dist(m) d permute(d, ser_permutation(c(3,2,1,4,5))) ## this also works for 1-mode data: # permute(d, ser_permutation_vector(c(3,2,1,4,5))) # permute(d, c(3,2,1,4,5))