powered by
S7_inherits() returns TRUE or FALSE.
S7_inherits()
TRUE
FALSE
check_is_S7() throws an error if x isn't the specified class.
check_is_S7()
x
class
S7_inherits(x, class = NULL)check_is_S7(x, class = NULL, arg = deparse(substitute(x)))
check_is_S7(x, class = NULL, arg = deparse(substitute(x)))
S7_inherits() returns a single TRUE or FALSE.
check_is_S7() returns nothing; it's called for its side-effects.
An object
An S7 class or NULL. If NULL, tests whether x is an S7 object without testing for a specific class.
NULL
Argument name used in error message.
foo1 <- new_class("foo1") foo2 <- new_class("foo2") S7_inherits(foo1(), foo1) check_is_S7(foo1()) check_is_S7(foo1(), foo1) S7_inherits(foo1(), foo2) try(check_is_S7(foo1(), foo2))
Run the code above in your browser using DataLab