Learn R Programming

PerMallows (version 1.14)

inversion: Inversion operator

Description

Given a permutation and a position, swap positions i and i+1

Usage

inversion(perm, i)

Value

The permutation in the input with an inversion at the specified position

Arguments

perm

a permutation

i

position of the permutation

Examples

Run this code
inversion(c(1,2,3,4,5),2)

Run the code above in your browser using DataLab