swap {PerMallows}R Documentation

Swap two items of a permutation

Description

Given a permutation and two position, swap both positions

Usage

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

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

[Package PerMallows version 1.13 Index]