Learn R Programming

assertive (version 0.2-6)

assert_is_S4: Is the input an S4 object?

Description

Checks to see if the input is an S4 object.

Usage

assert_is_S4(x)

assert_is_s4(x)

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

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

Arguments

x
Input to check.
.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

Run this code
assert_is_s4(getClass("MethodDefinition"))
#These examples should fail.
dont_stop(assert_is_s4(1:10))

Run the code above in your browser using DataLab