Learn R Programming

PerMallows (version 1.13)

decomp2perm: Get a permutation consistent with a decomposition vector

Description

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

Usage

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

Run this code
decomp2perm(c(1,0,1,0,0), "kendall")
decomp2perm(c(1,0,1,0,0), "cayley")
decomp2perm(c(1,0,1,0,0), "hamming")

Run the code above in your browser using DataLab