permutation: Permutations

Description Usage Arguments Value Examples

View source: R/permutation.R

Description

Gets a permutation of the integers 1-N by its index 1-N!.

Usage

1

Arguments

x

number (length 1 vector). The index of the permutation to generate. Must be less than factorial(n)

n

number (length 1 vector). The number of items in the permutation.

Value

Number vector of the integers 1-n re-ordered.

Examples

1
for (i in 1:24) print(permutation(i, 4))

graywh/r-gmisc documentation built on May 14, 2017, 3:07 p.m.