Learn R Programming

assertive (version 0.2-6)

assert_all_are_false: Is the input TRUE?

Description

Checks to see if the input is TRUE.

Usage

assert_all_are_false(x)

assert_any_are_false(x)

assert_is_identical_to_false(x, allow_attributes = FALSE)

assert_is_identical_to_true(x, allow_attributes = FALSE)

assert_all_are_true(x)

assert_any_are_true(x)

is_false(x)

is_identical_to_false(x, allow_attributes = FALSE,
  .xname = get_name_in_parent(x))

is_identical_to_true(x, allow_attributes = FALSE,
  .xname = get_name_in_parent(x))

is_true(x)

Arguments

x
Input to check.
allow_attributes
If TRUE, a scalar value of TRUE with attributes is allowed.
.xname
Not intended to be used directly.

Value

  • The is* functions return TRUE if the input is TRUE/FALSE. The assert_* functions return nothing but throw an error if the corresponding is_* function returns FALSE.

See Also

isTRUE.

Examples

Run this code
assert_is_identical_to_true(TRUE)
assert_is_identical_to_false(FALSE)
assert_is_identical_to_true(c(truth = TRUE), allow_attributes = TRUE)
assert_is_identical_to_false(matrix(FALSE), allow_attributes = TRUE)
x <- c(TRUE, FALSE, NA)
is_true(x)
is_false(x)
assert_any_are_true(x)
assert_any_are_false(x)
# These tests should fail:
dont_stop(assert_is_identical_to_true(c(truth = TRUE)))
dont_stop(assert_is_identical_to_false(matrix(FALSE)))
dont_stop(assert_all_are_true(x))
dont_stop(assert_all_are_false(x))

Run the code above in your browser using DataLab