traceMethods {RBioinf} | R Documentation

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

### 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

    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

    ## Not run:
       traceMethods{slice}
       untraceMethods{slice}
    ## End(Not run)

[Package RBioinf version 1.4.0 Index]