Description Usage Arguments Details Technical Details References See Also Examples
These functions provide methods for applying
groupGeneric
s to FunctionalData
objects.
Note that unary operators in Ops
group ("&"
, ""
and
"!"
) are not meaningful for FunctionalData
objects and
thus not implemented.
1 2 3 4 5 
x 
objects. 
... 
further arguments passed to methods. 
e1 
objects. 
e2 
objects. 
%% ————— grep nw DispatchGroup src/*/*[ch]
There are four groups for which S3 methods can be written,
namely the "Math"
, "Ops"
, "Summary"
and
"Complex"
groups. These are not R objects in base R, but
methods can be supplied for them and base R contains
factor
, data.frame
and
difftime
methods for the first three groups. (There is
also a ordered
method for Ops
,
POSIXt
and Date
methods for Math
and Ops
, package_version
methods for Ops
and Summary
, as well as a ts
method for
Ops
in package stats.)
Group "Math"
:
abs
, sign
, sqrt
,
floor
, ceiling
, trunc
,
round
, signif
exp
, log
, expm1
, log1p
,
cos
, sin
, tan
,
cospi
, sinpi
, tanpi
,
acos
, asin
, atan
cosh
, sinh
, tanh
,
acosh
, asinh
, atanh
lgamma
, gamma
, digamma
, trigamma
% do_math1() [../../../main/arithmetic.c:794]: if (DispatchGroup("Math",...))
%
%
% "atan", "round", "log", "signif":
% do_atan() [arithmetic.c:958]: if (DispatchGroup("Math", ..))
% do_round() [arithmetic.c:981]: if (DispatchGroup("Math", ..))
% do_log() [arithmetic.c:1011]:if (DispatchGroup("Math", ..))
% do_signif()[arithmetic.c:1034]:if (DispatchGroup("Math", ..))
cumsum
, cumprod
, cummax
, cummin
% do_cum() [cum.c:140]: if (DispatchGroup("Math", ...))
Members of this group dispatch on x
. Most members accept
only one argument, but members log
, round
and
signif
accept one or two arguments, and trunc
accepts
one or more.
Group "Ops"
:
"+"
, ""
, "*"
, "/"
,
"^"
, "%%"
, "%/%"
% do_arith() [arithmetic.c:240]: if (DispatchGroup("Ops", ...))
"&"
, ""
, "!"
% do_logic() [logic.c:32]: if (DispatchGroup("Ops",...))
"=="
, "!="
,
"<"
, "<="
, ">="
, ">"
% do_relop() [relop.c:35]: if (DispatchGroup("Ops", ...))
This group contains both binary and unary operators (+
,

and !
): when a unary operator is encountered the
Ops
method is called with one argument and e2
is
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
Ops
method. 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.
Note that the data.frame
methods for the comparison
("Compare"
: ==
, <
, ...) and logic
("Logic"
: &

and !
) operators return a
logical matrix
instead of a data frame, for
convenience and back compatibility.
If the members of this group are called as functions, any argument names are removed to ensure that positional matching is always used.
Group "Summary"
:
all
, any
% do_logic3()[logic.c:278]: if(DispatchGroup("Summary", ...))
sum
, prod
% /*NOMORE:mean
, */
min
, max
% do_summary() [summary.c:322]: if(DispatchGroup("Summary",...))
range
Members of this group dispatch on the first argument supplied.
Group "Complex"
:
Arg
, Conj
, Im
, Mod
, Re
% do_cmathfuns() [complex.c:267]: if(DispatchGroup("Complex",...))
Members of this group dispatch on z
.
Note that a method will be used for one of these groups or one of its
members only if it corresponds to a "class"
attribute,
as the internal code dispatches on oldClass
and not on
class
. This is for efficiency: having to dispatch on,
say, Ops.integer
would 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 groupgeneric functions.
These functions are all primitive and internal generic.
The details of method dispatch and variables such as .Generic
are discussed in the help for UseMethod
. There are a
few small differences:
For the operators of group Ops
, the object
.Method
is a lengthtwo character vector with elements the
methods selected for the left and right arguments respectively. (If
no method was selected, the corresponding element is ""
.)
Object .Group
records the group used for dispatch (if
a specific method is used this is ""
).
Appendix A, Classes and Methods of
Chambers, J. M. and Hastie, T. J. eds (1992)
Statistical Models in S.
Wadsworth & Brooks/Cole.
methods
for methods of noninternal generic functions.
S4groupGeneric for group generics for S4 methods.
1 2 3 4 5  f < SobolevData$new(c(0, 2 * pi), ~ .)
g < sin(f)
z1 < f + g
y0 < 1:10
z2 < f + y0

Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.