perm2decomp: Get the decomposition vector

Description Usage Arguments Value Examples

View source: R/PerMallows.R

Description

Given a permutation and a distance name generate the decomposition vector

Usage

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

Arguments

perm

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. For the Kendall distance is the inversion vector

Examples

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

Example output

Loading required package: Rcpp
[1] 0 0 1 0
[1] 0 0 1 0
[1] 0 0 1 1 0

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