Learn R Programming

PerMallows (version 1.14)

compose: 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)

Value

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

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).

Examples

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

Run the code above in your browser using DataLab