Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

permutation_matrix

Conversion Between Permutation Vector and Permutation Matrix


Description

Converts between permutation vectors and matrices.

Usage

permutation_matrix2vector(x)
permutation_vector2matrix(x)

Arguments

x

A permutation vector (any object that can be converted into a permutation vector, e.g., a integer vector or a hclust object) or a matrix representing a permutation. Arguments are checked.

Author(s)

Michael Hahsler

See Also

Examples

## 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)

seriation

Infrastructure for Ordering Objects Using Seriation

v1.2-9
GPL-3
Authors
Michael Hahsler [aut, cre, cph], Christian Buchta [aut, cph], Kurt Hornik [aut, cph], Fionn Murtagh [ctb, cph], Michael Brusco [ctb, cph], Stephanie Stahl [ctb, cph], Hans-Friedrich Koehn [ctb, cph]
Initial release
2020-09-29

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.