Learn R Programming

PerMallows (version 1.14)

perm2decomp: Get the decomposition vector

Description

Given a permutation and a distance name generate the decomposition vector

Usage

perm2decomp(perm, dist.name = "kendall")

Value

The distance decomposition vector of the given permutation and distance. For the Kendall distance is the inversion vector

Arguments

perm

the permutation

dist.name

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

Examples

Run this code
perm2decomp(c(1,2,4,3,5), "kendall")
perm2decomp(c(1,2,4,3,5), "cayley")
perm2decomp(c(1,2,4,3,5), "hamming")

Run the code above in your browser using DataLab