permutations: Generate permutations

Description Usage Arguments Details Examples

Description

Generates all length(x)! permutations of the elements in a vector x. If there are duplicate elements in x then there will be repeated 'permuations' in the result.

Usage

1

Arguments

x

The vector to create permutations of

Details

The result is a list where each element is a vector containing one of the permutations.

Examples

1
2
3
permutations(1:3)
permutations(c("a", "b", "c"))
permutations(c("raptors", "are", "horrible"))

Dasonk/Dmisc documentation built on May 6, 2019, 1:36 p.m.