Learn R Programming

MSCquartets (version 3.1)

allPerms: Generate permutations

Description

Generate all permutations of 1 to n, as rows of a matrix

Usage

allPerms(n)

Value

an n!xn matrix whose rows give permutations

Arguments

n

size of permutations

Examples

Run this code
allPerms(4)

Run the code above in your browser using DataLab