Learn R Programming

StatMethRank (version 1.3)

generate.combs: Generate all possible combinations of k elements out of n

Description

This function generates all combinations of n elements taken k at a time. It is just a reference to the combn function in utils package.

Usage

generate.combs(n, k = 1)

Arguments

n
number of the whole elements
k
number of elements to choose (default 1)

Value

a matrix or a vector

See Also

utils::combn

Examples

Run this code
generate.combs(10, 6)

Run the code above in your browser using DataLab