traceMethods: A function to turn on tracing for all methods of a S4 generic...

Description Usage Arguments Details Value Author(s) See Also Examples

View source: R/debug.R

Description

This function can turn on tracing for all methods (or a subset of the methods) of a generic function. It is useful when debugging, as it can help see how the methods are being traversed.

Usage

1
2
traceMethods(generic, traceStrings, tracer)
untraceMethods(generic, methodSigs)

Arguments

generic

The name of the generic function, quoted or not.

traceStrings

A string to print when each method is entered.

tracer

A function to insert as the tracer, if missing a function that prints the methods signature is used.

methodSigs

A set of method signatures, as a character vector, that tracing will be turned off for.

Details

traceMethods uses showMethods to figure out what methods exist, and what the signatures are. It then uses trace to set a trace on all methods.

untraceMethods uses the returned value of traceMethods, or any other similar construct to untrace methods for a generic.

Value

A vector of method signatures is returned. This could be then used to untrace the methods (something else to automate).

Author(s)

R. Gentleman

See Also

showMethods, trace

Examples

1
2
3
4
5
## Not run: 
   traceMethods{slice}
   untraceMethods{slice}

## End(Not run)

RBioinf documentation built on Nov. 8, 2020, 11:11 p.m.