Learn R Programming

assertive (version 0.2-6)

assert_is_not_null: Is the input (not) null?

Description

Checks to see if the input is (not) null.

Usage

assert_is_not_null(x)

assert_is_null(x)

is_not_null(x, .xname = get_name_in_parent(x))

is_null(x, .xname = get_name_in_parent(x))

Arguments

x
Input to check.
.xname
Not intended to be used directly.

Value

  • is_null wraps is.null, providing more information on failure. is_not_null returns TRUE in the opposite case. The assert_* functions return nothing but throw an error if the corresponding is_* function returns FALSE.

See Also

is.null.

Examples

Run this code
assert_is_null(NULL)
assert_is_null(c())
assert_is_not_null(NA)

Run the code above in your browser using DataLab