| class_missing | R Documentation |
Use class_missing to dispatch when no argument value is available.
Omitted arguments with defaults dispatch on the default's class.
Missing values detected by is.na() do not trigger class_missing dispatch.
class_missing
Sentinel objects used for special types of dispatch.
foo := new_generic("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.