S4_register {S7} | R Documentation |
Register an S7 class with S4
Description
If you want to use method<- to register an method for an S4 generic with
an S7 class, you need to call S4_register()
once.
Usage
S4_register(class, env = parent.frame())
Arguments
class |
An S7 class created with |
env |
Expert use only. Environment where S4 class will be registered. |
Value
Nothing; the function is called for its side-effect.
Examples
methods::setGeneric("S4_generic", function(x) {
standardGeneric("S4_generic")
})
foo <- new_class("foo")
S4_register(foo)
method(S4_generic, foo) <- function(x) "Hello"
S4_generic(foo())
[Package S7 version 0.1.1 Index]