Learn R Programming

salso (version 0.3.53)

enumerate.permutations: Enumerate Permutations of Items

Description

This function produces a matrix whose rows provide all possible permutations of the set \({1, 2, ..., n}\).

Usage

enumerate.permutations(nItems)

Value

A matrix of integers, where each row is a permutation.

Arguments

nItems

The size of the set \({1, 2, ..., n}\), i.e., \(n\).

Examples

Run this code
enumerate.permutations(5)

Run the code above in your browser using DataLab