perms {lca}R Documentation

List groups of permutations.

Description

Produces a list of possible permutations of n integers subject to restrictions.

Usage

perms(n, pattern = rep(1, n))

Arguments

n the number of integers to permute.
pattern pattern of restrictions.

Details

If the ith and jth positions of pattern differ, then permutations of i and j are not included.

Value

A matrix, each row of which is a permutation of 1:n.

Author(s)

Robin Evans

See Also

permutations

Examples

perms(4)

# Permute two components (c(1,3) and c(2,4,5) separately)
perms(5, c(1,2,1,2,2))

[Package lca version 0.2 Index]