assert_is_all_of: Does x belong to these classes?

Description Usage Arguments Value See Also Examples

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

Description

Checks to see if x belongs to any of the classes in classes.

Usage

1
2
3
4
5
assert_is_all_of(x, classes, severity = getOption("assertive.severity",
  "stop"))

assert_is_any_of(x, classes, severity = getOption("assertive.severity",
  "stop"))

Arguments

x

Input to check.

classes

As for class.

severity

How severe should the consequences of the assertion be? Either "stop", "warning", "message", or "none".

Value

The functions return nothing but throw an error if x does not have any/all of the class classes.

See Also

is2

Examples

1
2
3
assert_is_all_of(1:10, c("integer", "numeric"))
#These examples should fail.
assertive.base::dont_stop(assert_is_any_of(1:10, c("list", "data.frame")))

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