is_list: Is the input a list?

Description Usage Arguments Value See Also Examples

View source: R/is-type-base.R

Description

Checks to see if the input is a list.

Usage

1
2
3
4
5
6
7
assert_is_list(x, severity = getOption("assertive.severity", "stop"))

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

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

is_pairlist(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

1
2
3
4
5
6
7
assert_is_list(list(1,2,3))
assert_is_pairlist(.Options)
#These examples should fail.
assertive.base::dont_stop({
  assert_is_list(1:10)
  assert_is_pairlist(options())
})

assertive.types documentation built on May 1, 2019, 10:31 p.m.