perm: Vector Permutations

Description Usage Arguments Value See Also Examples

View source: R/util.R

Description

Enumerates all permutations of a vector

Usage

1
perm(vec,duplicates=FALSE)

Arguments

vec

The vector to permute

duplicates

Should duplicate permutations be listed

Value

Returns a matrix where each row is a permutation of vec. All possible permutations are listed, and if duplicates=TRUE non-unique permutations are also listed.

See Also

sample

Examples

1
2
perm(1:4)
perm(LETTERS[4:8])

Deducer documentation built on May 29, 2017, 10:43 p.m.

Search within the Deducer package
Search all R packages, documentation and source code