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
`:=`()
Create and name an object in one step
`method<-`()
Register an S7 method for a generic
S7_inherits() check_is_S7()
Does this object inherit from a 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() prop_info()
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
super()
Force method dispatch to use a superclass

Introspection

method()
Find a method for an S7 generic
method_explain()
Explain method dispatch
S7_class()
Retrieve the class specification of an object
S7_class_desc()
Format a class specification as a string

Packages

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

S7_on_load() methods_register() S7_on_build()
Package hooks for S7 methods
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.