compose: Compose Permutations

View source: R/PerMallows.R

composeR Documentation

Compose Permutations

Description

This function composes two permutations or a permutation with a collection of permutations. If one of the arguments is a collection of permutations, the function will compose each permutation in the collection with the other argument. Note that both arguments cannot be collections of permutations at the same time.

Usage

compose(perm1, perm2)

Arguments

perm1

A single permutation (as a vector) or a collection of permutations (as a list of vectors).

perm2

A single permutation (as a vector) or a collection of permutations (as a list of vectors).

Value

The composition of the permutations. If one of the arguments is a collection, the result will be a list of composed permutations.

Examples

# Compose two single permutations
compose(c(3, 1, 2, 4), c(4, 1, 3, 2))

PerMallows documentation built on April 3, 2025, 11:09 p.m.