Learn R Programming

PerMallows (version 1.14)

insert: Insert operator

Description

Given a permutation and two positions i, j, move item in position i to position j

Usage

insert(perm, i, j)

Value

The permutation in the input in which th eoperation has been applied

Arguments

perm

a permutation

i

position of the permutation

j

position of the permutation

Examples

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

Run the code above in your browser using DataLab