combn {set} R Documentation

Generate All Combinations of n Elements, Taken m at a Time

Description


Generate all combinations of the elements of x taken
m at a time. If x is a positive integer, returns all
combinations of the elements of seq(x) taken m at a
time. If argument FUN is not NULL, applies a function
given by the argument to each point. If simplify is
FALSE, returns a list; otherwise returns an array, typically
a matrix. ... are passed unchanged to the FUN function,
if specified.

Usage

combn(x, m);

Arguments

x

vector source For combinations, Or Integer n For x <- seq_len(n). [as Array]

m

number of elements to choose. [as integer]

Details

Factors x are accepted.

Authors

SMRUCC genomics Institute

Value

A list or array, see the simplify argument above. In the latter case, the identity dim(combn(n, m)) == c(m, choose(n, m)) holds.

clr value class

Examples


[Package set version 2.33.856.6961 Index]