Learn R Programming

oeli (version 0.5.2)

permutations: Build permutations

Description

This function creates all permutations of a given vector.

Usage

permutations(x)

Value

A list of all permutations of x.

Arguments

x

Any vector.

References

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

Examples

Run this code
permutations(1:3)
permutations(LETTERS[1:3])

Run the code above in your browser using DataLab