decomp2perm: Get a permutation consistent with a decomposition vector

Description Usage Arguments Value Examples

View source: R/PerMallows.R

Description

Given a distance decomposition vector and a distance name, generate uniformly at random a permutation consistent with the decomposition vector.

Usage

1
decomp2perm(vec, dist.name = "kendall")

Arguments

vec

the permutation

dist.name

optional the name of the distance. One of: kendall (default), cayley, hamming

Value

The distance decomposition vector of the given permutation and distance

Examples

1
2
3
decomp2perm(c(1,0,1,0,0), "kendall")
decomp2perm(c(1,0,1,0,0), "cayley")
decomp2perm(c(1,0,1,0,0), "hamming")

Example output

Loading required package: Rcpp
[1] 2 1 4 3 5 6
[1] 3 2 4 1 5 6
[1] 3 2 1 4 5

PerMallows documentation built on May 2, 2019, 6:14 a.m.