S7_inherits {S7} | R Documentation |
Does this object inherit from an S7 class?
Description
-
S7_inherits()
returnsTRUE
orFALSE
. -
check_is_S7()
throws an error ifx
isn't the specifiedclass
.
Usage
S7_inherits(x, class = NULL)
check_is_S7(x, class = NULL, arg = deparse(substitute(x)))
Arguments
x |
An object |
class |
An S7 class or |
arg |
Argument name used in error message. |
Value
-
S7_inherits()
returns a singleTRUE
orFALSE
. -
check_is_S7()
returns nothing; it's called for its side-effects.
Examples
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))
[Package S7 version 0.1.1 Index]