class_missing {S7} | R Documentation |
Special dispatch types
Description
Use
class_missing
when the user has not supplied an argumentUse
class_any
for a default method that is called only if no other methods are matched
Usage
class_missing
class_any
Format
An object of class S7_missing
of length 0.
An object of class S7_any
of length 0.
Value
Sentinel objects used for special types of dispatch.
Examples
foo <- new_generic("foo", "x")
method(foo, class_integer) <- function(x) "integer"
method(foo, class_missing) <- function(x) "missing"
method(foo, class_any) <- function(x) "fallback"
foo(1)
foo()
foo("x")
[Package S7 version 0.1.1 Index]