Validates that the value belongs to a given class. One verb covers the
types without a dedicated check, including factor, Date, POSIXct,
list, and fitted-model objects such as lm.
Arguments
- restriction
a
restrictionobject.- class
character(1) class name to require.
- exact
logical; if
TRUE, requiresclass(value)[1]to equalclassexactly. IfFALSE(default), tests inheritance withinherits(), so a subclass passes.
See also
Other type checks:
require_character(),
require_df(),
require_integer(),
require_logical(),
require_numeric()