swap: Swap two items of a permutation

Description Usage Arguments Value Examples

View source: R/PerMallows.R

Description

Given a permutation and two position, swap both positions

Usage

1
swap(perm, i, j)

Arguments

perm

a permutation

i

position of the permutation

j

position of the permutation

Value

The permutation in the input in which the two speicfied items have been swapped

Examples

1
swap(c(1,2,3,4,5),2,5)

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

Related to swap in PerMallows...