is.binaryMatrix: Check For Binary Matrix

Description Usage Arguments Value Author(s) Examples

View source: R/is.binaryMatrix.R

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

1

Arguments

m

a matrix.

Value

is.binaryMatrix returns either TRUE or FALSE.

Author(s)

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

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
# 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

binda documentation built on Nov. 21, 2021, 1:07 a.m.

Related to is.binaryMatrix in binda...