Learn R Programming

frt (version 0.1)

comb: Build a matrix with combinations of zeros and ones.

Description

Internal function, generally not called by users.

Usage

comb(m, n)

Arguments

m
an integer, corresponding to the number of zeros. It must be greater or equal to zero.
n
an integer, corresponding to the number of ones. It must be greater or equal to zero.

Value

Details

comb builds the matrix with all combinations of m zeros and n ones. The output matrix will hence have as number of columns $nc=m+n$ and as number of rows $nr = (m + n)! / (m!n!)$, which is the number of all the possible combinations. Each row will contain one of the $nr$ possible combinations of m zeros and n ones.