Learn R Programming

perm (version 0.9-9.5)

chooseMatrix: Create matrix with choose(n,m) unique rows with m ones in each row the rest 0.

Description

Create a choose(n,m) by n matrix. The matrix has unique rows with m ones in each row and the rest zeros.

Usage

chooseMatrix(n, m)

Arguments

n
an integer
m
an integer

Value

  • A matrix with choose(n,m) rows n columns. The matrix has unique rows with m ones in each row and the rest zeros.

See Also

permTS

Examples

Run this code
chooseMatrix(5,2)

Run the code above in your browser using DataLab