Learn R Programming

Tex4exams (version 0.1.2)

perm: Lists permutations of a vector with distinct entries

Description

perm(v) lists permutations of a vector v with distinct entries. The output is a matrix with each row a permutation. It cannot distinguish identical permutations.

Usage

perm(v)

Value

an n! by n matrix with each row a permuation of the enties of v.

Arguments

v

is a vector with distinct entries.

See Also

permucycle, permuorder,cycledisplay

Examples

Run this code
x <-  sample(c((-10):10),3)
perm(x)

Run the code above in your browser using DataLab