chk_zero: Check if 'x1' is zero, conditional on whether 'x2' is zero

Description Usage Arguments Details See Also Examples

Description

chk_zero_if_zero checks that x1 is 0, given that x2 is 0.

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
chk_zero_if_zero(x1, x2, name1, name2)

chk_zero_onlyif_zero(x1, x2, name1, name2)

chk_zero_ifonlyif_zero(x1, x2, name1, name2)

err_zero_if_zero(x1, x2, name1, name2)

err_zero_onlyif_zero(x1, x2, name1, name2)

err_zero_ifonlyif_zero(x1, x2, name1, name2)

Arguments

x1

An argument that could be 0.

x2

An argument that could be 0.

name1

The name for x1 that will be used in error messages.

name2

The name for x2 that will be used in error messages.

Details

chk_zero_onlyif_zero checks that x1 is only 0 when x2 is 0.

chk_zero_ifonlyif_zero checks that x1 and x2 are both 0 or are both non-0.

See Also

chk_zero

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
x1 <- 0
x2 <- 2
chk_zero_if_zero(x1 = x1, x2 = x2, name1 = "x1", name2 = "x2")
x1 <- 0
x2 <- 0
chk_zero_if_zero(x1 = x1, x2 = x2, name1 = "x1", name2 = "x2")
x1 <- 1
x2 <- 0
chk_zero_onlyif_zero(x1 = x1, x2 = x2, name1 = "x1", name2 = "x2")
x1 <- 0
x2 <- 0
chk_zero_onlyif_zero(x1 = x1, x2 = x2, name1 = "x1", name2 = "x2")
x1 <- 1
x2 <- 2
chk_zero_ifonlyif_zero(x1 = x1, x2 = x2, name1 = "x1", name2 = "x2")
x1 <- 0
x2 <- 0
chk_zero_ifonlyif_zero(x1 = x1, x2 = x2, name1 = "x1", name2 = "x2")

johnrbryant/demcheck documentation built on Dec. 31, 2021, 11:57 a.m.