permute: Return all permutations of a vector

Description Usage Arguments Value See Also Examples

View source: R/tukey.R

Description

Recursively generates all permutations of a vector. The result will be factorial(length(vals)) long so be careful with any longer vectors (e.g. longer than 10).

Usage

1
permute(vals)

Arguments

vals

a vector of elements to be permuted

Value

A list of vectors containing all permutation of the values

See Also

sample

Examples

1
2
permute(letters[1:3])
permute(1:5)

vipor documentation built on May 1, 2019, 7:06 p.m.