is.binaryMatrix {binda}R Documentation

Check For Binary Matrix

Description

is.binaryMatrix tests whether m is a matrix and whether it contains only 0s and 1s.

Note that functions like binda.ranking and binda require a binary matrix as input.

Usage

is.binaryMatrix(m)

Arguments

m

a matrix.

Value

is.binaryMatrix returns either TRUE or FALSE.

Author(s)

Sebastian Gibb and Korbinian Strimmer (https://strimmerlab.github.io).

Examples

# load binda library
library("binda")

# test matrix
m = matrix(c(1, 1, 0, 1, 0, 0,
             1, 1, 1, 1, 0, 0,
             1, 0, 0, 0, 1, 1,
             1, 0, 0, 0, 1, 1), nrow=4, byrow=TRUE)

# Test for binary matrix
is.binaryMatrix(m) # TRUE

[Package binda version 1.0.4 Index]