assertive.types (version 0.0-1)

assert_is_list: Is the input a list?

Description

Checks to see if the input is a list.

Usage

assert_is_list(x, severity = getOption("assertive.severity", "stop"))

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

Arguments

x
Input to check.
severity
How severe should the consequences of the assertion be? Either "stop", "warning", "message", or "none".
.xname
Not intended to be used directly.

Value

  • is_list wraps is.list, providing more information on failure.

See Also

is.list.

Examples

Run this code
assert_is_list(list(1,2,3))
#These examples should fail.
assertive.base::dont_stop(assert_is_list(1:10))

Run the code above in your browser using DataCamp Workspace