Complex. (There are no objects of these names in base R, but there are in the methods package.) A method defined for an individual member of the group takes precedence over a method defined for the group as a whole.
## S3 methods for group generics have prototypes:
Summary(\dots, na.rm = FALSE)
.Genericare discussed in the help for
UseMethod. There are a few small differences:
Ops, the object
.Methodis a length-two character vector with elements the methods selected for the left and right arguments respectively. (If no method was selected, the corresponding element is
.Grouprecords the group used for dispatch (if a specific method is used this is
"Complex"groups. These are not R objects in base R, but methods can be supplied for them and base R contains
difftimemethods for the first three groups. (There is also a
Summary, as well as a
Opsin package stats.)
x. Most members accept only one argument, but members
signifaccept one or two arguments, and
truncaccepts one or more.
!): when a unary operator is encountered the
Opsmethod is called with one argument and
e2is missing. The classes of both arguments are considered in dispatching any member of this group. For each argument its vector of classes is examined to see if there is a matching specific (preferred) or
Opsmethod. If a method is found for just one argument or the same method is found for both, it is used. If different methods are found, there is a warning about ‘incompatible methods’: in that case or if no method is found for either argument the internal method is used. If the members of this group are called as functions, any argument names are removed to ensure that positional matching is always used.
"class"attribute, as the internal code dispatches on
oldClassand not on
class. This is for efficiency: having to dispatch on, say,
Ops.integerwould be too slow. The number of arguments supplied for primitive members of the
"Math"group generic methods is not checked prior to dispatch. There is no lazy evaluation of arguments for group-generic functions.
methodsfor methods of non-internal generic functions. S4groupGeneric for group generics for S4 methods.