Learn R Programming

prob (version 0.9-1)

permsn: Generate All Permutations of x Elements Taken m at a Time

Description

Generate all permutations of the elements of x taken m at a time. If x is a positive integer, returns all permutations of the elements of seq(x) taken m at a time.

Usage

permsn(x, m)

Arguments

x
vector source for permutations, or integer n for x <- seq(n).
m
number of elements to permute.

Value

  • a list or array (in nondegenerate cases).

See Also

combn

Examples

Run this code
permsn(3,2)

Run the code above in your browser using DataLab