Conversion Between Permutation Vector and Permutation Matrix
Converts between permutation vectors and matrices.
permutation_matrix2vector(x) permutation_vector2matrix(x)
x |
A permutation vector (any object that can be converted into a
permutation vector, e.g., a integer vector or a |
Michael Hahsler
## create a random permutation vector pv <- sample(1:5) pv ## convert into a permutation matrix pm <- permutation_vector2matrix(pv) pm ## convert back permutation_matrix2vector(pm)
Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.