MbetterGreater: Matrix Better Greater Than

Description Usage Arguments Value Examples

View source: R/betterGreater.R

Description

Test two matrices element by element to see if the first is greater than the second, where NA entries are considered equal and less than -Inf

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 entry of the first matrix is greater than that of the second (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(-Inf, 12), 24:19), nrow = 6)
m4 = matrix(c(rep(NA, 12), 1:12), nrow = 6)
MbetterGreater(m2, m1)
MbetterGreater(m1, m3)
MbetterGreater(m1, m4)
MbetterGreater(m2, m3)
MbetterGreater(m2, m4)
MbetterGreater(m3, m4)

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