Learn R Programming

assertive (version 0.3-0)

assert_is_all_of: Does x belong to these classes?

Description

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

Usage

assert_is_all_of(x, classes)

assert_is_any_of(x, classes)

Arguments

x
Input to check.
classes
As for class.

Value

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

See Also

is2

Examples

Run this code
assert_is_all_of(1:10, c("integer", "numeric"))
#These examples should fail.
dont_stop(assert_is_any_of(1:10, c("list", "data.frame")))

Run the code above in your browser using DataLab