distance | R Documentation |
Compute the distance between two given permutations. If only one permutation is given the other one is assumed to be the identity (1,2,3,....,n) The distance can be kendall, cayley, hamming and ulam
distance(
perm1,
perm2 = identity.permutation(length(perm1)),
dist.name = "kendall"
)
perm1 |
a permutation |
perm2 |
optional a permutation |
dist.name |
optional. One of: kendall (default), cayley, hamming, ulam |
The distance between the permutations
distance(c(1,2,3,5,4))
distance(c(1,2,3,5,4), c(1,2,3,5,4))
distance(c(1,2,3,5,4), c(1,4,2,3,5), "cayley")
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.