Skip to contents

Key functions

new_class() new_object()
Define a new S7 class
new_generic() S7_dispatch()
Define a new generic
new_union()
Define a class union
`method<-`()
Register an S7 method for a generic
S7_inherits() check_is_S7()
Does this object inherit from an S7 class?
validate() valid_eventually() valid_implicitly()
Validate an S7 object

Properties

new_property()
Define a new property
prop() `prop<-`() `@`()
Get/set a property
prop_names() prop_exists()
Property introspection
props() `props<-`() set_props()
Get/set multiple properties
S7_data() `S7_data<-`()
Get/set underlying "base" data

Method dispatch

convert()
Convert an object from one type to another
class_missing
Dispatch on a missing argument
class_any
Dispatch on any class
method()
Find a method for an S7 generic
method_explain()
Explain method dispatch
super()
Force method dispatch to use a superclass
S7_class()
Retrieve the S7 class of an object

Packages

Functions needed when using S7 within a package. See vignette("packages") for more details.

methods_register()
Register methods in a package
new_external_generic()
Generics in other packages

Compatibility

These tools provide a layer of compatibility between S7 and S3 classes, S4 classes, and base types. See vignette("compatibility") for more details.