How does the input relate to a value?

isEqualTo(x, y)

isNotEqualTo(x, y)

isGreaterThan(x, y)

isGreaterThanOrEqualTo(x, y)

isLessThan(x, y)

isLessThanOrEqualTo(x, y)

allAreEqualTo(x, y)

allAreNotEqualTo(x, y)

allAreGreaterThan(x, y)

allAreGreaterThanOrEqualTo(x, y)

allAreLessThan(x, y)

allAreLessThanOrEqualTo(x, y)

Arguments

x Object. Secondary object.

Value

logical.

Functions

• isEqualTo: Vectorized.

• isNotEqualTo: Vectorized.

• isGreaterThan: Vectorized.

• isGreaterThanOrEqualTo: Vectorized.

• isLessThan: Vectorized.

• isLessThanOrEqualTo: Vectorized.

• allAreEqualTo: Scalar.

• allAreNotEqualTo: Scalar.

• allAreGreaterThan: Scalar.

• allAreGreaterThanOrEqualTo: Scalar.

• allAreLessThan: Scalar.

• allAreLessThanOrEqualTo: Scalar.

Note

These functions return logical, not necessarily logical(1).

• Primitives: ==, >, >=, <, <=.

• assertive.numbers::is_equal_to().

• assertive.numbers::is_not_equal_to().

• assertive.numbers::is_greater_than().

• assertive.numbers::is_greater_than_or_equal_to().

• assertive.numbers::is_less_than().

• assertive.numbers::is_less_than_or_equal_to().

Examples

## TRUE ====
isEqualTo(x = 1L, y = 1)#>    1
#> TRUE isNotEqualTo(x = 2, y = 1)#>    2
#> TRUE isGreaterThan(x = 1, y = 0)#>    1
#> TRUE isGreaterThanOrEqualTo(x = seq_len(2), y = 1)#>    1    2
#> TRUE TRUE isLessThan(x = -1, y = 0)#>   -1
#> TRUE isLessThanOrEqualTo(x = seq_len(2), y = 3)#>    1    2
#> TRUE TRUE
## FALSE ====
isEqualTo(x = seq_len(2), y = 1)#> There was 1 failure:
#>   pos value                        cause
#> 1   2     2 not equal to 1; abs diff = 1