nchoosek {vsn} | R Documentation |
List all subsets of size k from n objects
nchoosek(n, k)
n |
Integer |
k |
Integer |
A matrix with k rows and as many columns as there are distinct subsets. Each column contains integers between 1 and n, and represents a subset.
nchoosek(5,3)