permutation_vector2matrix {seriation} | R Documentation |
Conversion Between Permutation Vector and Permutation Matrix
Description
Converts between permutation vectors and matrices.
Usage
permutation_vector2matrix(x)
permutation_matrix2vector(x)
Arguments
x |
A permutation vector (any object that can be converted into a
permutation vector, e.g., a integer vector or a |
Value
-
permutation_vector2matrix()
: returns a permutation matrix. -
permutation_matrix2vector()
: returns the permutation as a integer vector.
Author(s)
Michael Hahsler
See Also
Other permutation:
get_order()
,
permute()
,
ser_dist()
,
ser_permutation()
,
ser_permutation_vector()
Examples
## create a random permutation vector
pv <- structure(sample(5), names = paste0("X", 1:5))
pv
## convert into a permutation matrix
pm <- permutation_vector2matrix(pv)
pm
## convert back
permutation_matrix2vector(pm)
[Package seriation version 1.5.5 Index]