permutations: Build permutations

View source: R/permutations.R

permutationsR Documentation

Build permutations

Description

This function creates all permutations of a given vector.

Usage

permutations(x)

Arguments

x

[atomic()]
Any vector.

Value

A list of all permutations of x.

References

Modified version of https://stackoverflow.com/a/20199902/15157768.

See Also

Other vector helpers: check_numeric_vector(), check_probability_vector(), chunk_vector(), insert_vector_entry(), match_numerics(), split_vector_at(), subsets(), vector_occurrence()

Examples

permutations(1:3)
permutations(LETTERS[1:3])

oeli documentation built on Oct. 16, 2024, 5:08 p.m.