Learn R Programming

mixAK (version 5.4)

generatePermutations: Generate all permutations of (1, ..., K)

Description

It generates a matrix containing all permutations of (1, ..., K).

Usage

generatePermutations(K)

Value

A matrix of dimension \(K! \times K\) with generated permutations in rows.

Arguments

K

integer value of \(K\).

Author

Arnošt Komárek arnost.komarek@mff.cuni.cz

Examples

Run this code
generatePermutations(1)
generatePermutations(2)
generatePermutations(3)
generatePermutations(4)

Run the code above in your browser using DataLab