insert: Insert operator

Description Usage Arguments Value Examples

View source: R/PerMallows.R

Description

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

Usage

1
insert(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 th eoperation has been applied

Examples

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

Example output

Loading required package: Rcpp
[1] 1 2 5 3 4
[1]  1  3  4  5  2 NA  5

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