binmat: Create a matrix of all binary combinations

Description Usage Arguments Value Author(s) See Also Examples

Description

Create a matrix of all binary combinations for use with the hyperdirichlet distribution

Usage

1
binmat(n, alternatives = NULL, pnames=NULL)

Arguments

n

Number of binary digits

alternatives

The alternatives; prototypically TRUE and FALSE, but default NULL, taken to mean 0 and 1, is easier on the eye

pnames

Optional vector specifying the column names; default of NULL means to use p1,p2 etc

Value

Function binmat(n) returns an integer matrix of zeros and ones with 2^n rows and n columns. In binary, the rows count from 0 to 2^n-1.

Author(s)

Robin K. S. Hankin

See Also

print.hyperdirichlet

Examples

1
2
3
binmat(4)

binmat(3,alternatives=c(TRUE,FALSE))

hyperdirichlet documentation built on May 31, 2017, 5:18 a.m.