rational_group_generics | R Documentation |
Group generics allow you to implement methods for many generics at once. You cannot call a group generic directly; instead it is called automatically by members of the group if a more specific method is not found. For example, if you define a method for the 'S7_Math' group generic, it will be called when you call 'abs()', 'sign()', 'sqrt()', and many other similar generics (see below for a complete list).
S7_Math(x, ..., .Generic)
S7_Ops(e1, e2, ..., .Generic)
S7_Compare(e1, e2, ..., .Generic)
S7_Add(e1, e2, ..., .Generic)
find_base_generic(.Generic)
x , e1 , e2 |
Objects used for dispatch. |
... |
Additional arguments passed to methods. |
.Generic |
The name of the generic being dispatched on, i.e. if you've defined a method for 'S7_Math' and the user calls 'abs()' then '.Generic' will be '"abs"'. Use 'find_base_generic()' to find the base generic that corresponds to the generic name. |
# Methods
The group generics contain the following methods:
* 'Ops': 'r paste(group_generics_md("Compare"), group_generics_md("Arith"), group_generics_md("Logic")) ' * 'Math': 'r group_generics_md("Math")' * 'Summary': 'r group_generics_md("Summary")' * 'Complex': 'r group_generics_md("Complex")' * 'matrixOps': 'r group_generics_md("matrixOps")'
https://github.com/RConsortium/S7/blob/group-generics/R/method-group.R
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.