testInheritedMethods(f, signatures, test = TRUE, virtual = FALSE, groupMethods = TRUE, where = .GlobalEnv)
testInheritedMethods. See the Details for how this is done. This argument might be supplied after a call with
test = FALSE, to test selection in batches.
FALSE, returns just the list of relevant signatures for subclasses, without calling
selectMethodfor each signature. If there are a very large number of signatures, you may want to collect the full list and then test them in batches.
"methodSelectionReport". The details of this class are currently subject to change. It has slots
"note", all referring to the ambiguous cases (and so of length 0 if there were none). These slots are intended to be examined by the programmer to detect and preferably fix ambiguous method selections. The object contains in addition slots
"generic", the name of the generic function, and
"allSelections", giving the vector of labels for all the signatures tested.
findMethodSignatures. From these all the known non-virtual subclasses are found for each class that appears in the signature of some method. These subclasses are split into groups according to which class they inherit from, and only one subclass from each group is retained (for each argument in the generic signature). So if a method was defined with class
"vector"for some argument, one actual vector class is chosen arbitrarily. The case of
"ANY"is dealt with specially, since all classes extend it. A dummy, nonvirtual class,
".Other", is used to correspond to all classes that have no superclasses among those being tested.
All combinations of retained subclasses for the
arguments in the generic signature are then computed.
Each row of the resulting matrix is a signature to be tested by a call
To collect information on ambiguous selections,
testInheritedMethods establishes a calling handler for the
"ambiguousMethodSelection", by setting the
Chambers, John M. (2009) Class Inheritance in R https://statweb.stanford.edu/~jmc4/classInheritance.pdf.