assertive.types (version 0.0-1)

assert_all_are_classes: Is the input the name of a (formally defined) class?

Description

Checks to see if the input is the name of a (formally defined) class.

Usage

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

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

is_class(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_class is a vectorised wrapper for isClass. assert_is_class returns nothing but throws an error if is_class returns FALSE.

See Also

isClass.

Examples

Run this code
assert_all_are_classes(c("lm", "numeric"))

Run the code above in your browser using DataLab