is_s4: Is the input an S4 object?

Description Usage Arguments Value See Also Examples

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

Description

Checks to see if the input is an S4 object.

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
assert_is_S4(x, severity = getOption("assertive.severity", "stop"))

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

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

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

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

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

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

is_ref_class_object(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_S4 wraps isS4, providing more information on failure. assert_is_S4 returns nothing but throws an error if is_S4 returns FALSE.

See Also

isS4.

Examples

1
2
3
assert_is_s4(getClass("MethodDefinition"))
# These examples should fail.
assertive.base::dont_stop(assert_is_s4(1:10))

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