assert_is_zero_matrix
Is the input a zero matrix
Checks that the input is a matrix of zeroes.
Usage
assert_is_zero_matrix(x, tol = 100 * .Machine$double.eps,
severity = getOption("assertive.severity", "stop"))is_zero_matrix(x, tol = 100 * .Machine$double.eps,
.xname = get_name_in_parent(x))
Arguments
- x
Input to check.
- tol
Absolute values smaller than
tol
are not considered.- severity
How severe should the consequences of the assertion be? Either
"stop"
,"warning"
,"message"
, or"none"
.- .xname
Not intended to be used directly.
Value
TRUE
if the input is all zeroes (after coercion to be a
matrix).
Examples
# NOT RUN {
x <- matrix(numeric(9), 3)
is_zero_matrix(x)
x[1, 1] <- 100 * .Machine$double.eps
is_zero_matrix(x)
x[2, 2] <- 101 * .Machine$double.eps
is_zero_matrix(x)
# }
Community examples
Looks like there are no examples yet.