MbetterComp: Matrix Better Comparison

Description Usage Arguments Value Examples

View source: R/MbetterComp.R

Description

Test two matrices for equality, where NA entries are considered equal

Usage

1

Arguments

x

A numeric matrix

y

A numeric matrix with the same dimensions as x

Value

a logical matrix of the same dimensions as the inputs, showing TRUE if the corresponding input entries have equal values (where NA entries are considered equal and less than -Inf), otherwise FALSE.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
m1 = matrix(data = c(1:12, 1:12), nrow = 6)
m2 = matrix(1:24, nrow = 6)
m3 = matrix(c(1:6, rep(NA, 12), 11:6), nrow = 6)
m4 = matrix(c(rep(NA, 12), 1:12), nrow = 6)
MbetterComp(m1, m2)
MbetterComp(m1, m3)
MbetterComp(m1, m4)
MbetterComp(m2, m3)
MbetterComp(m2, m4)
MbetterComp(m3, m4)

debarros/dbTools documentation built on Sept. 18, 2020, 10:51 a.m.