Learn R Programming

PerMallows (version 1.1)

inversion.at: Inversion operator

Description

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

Usage

inversion.at(perm, i)

Arguments

perm
a permutation
i
position of the permutation

Value

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

Examples

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

Run the code above in your browser using DataLab