class_missing | R Documentation |
Use class_missing
to dispatch when the user has not supplied an argument,
i.e. it's missing in the sense of missing()
, not in the sense of
is.na()
.
class_missing
Sentinel objects used for special types of dispatch.
foo <- new_generic("foo", "x")
method(foo, class_numeric) <- function(x) "number"
method(foo, class_missing) <- function(x) "missing"
method(foo, class_any) <- function(x) "fallback"
foo(1)
foo()
foo("")
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.