getS3method {utils} | R Documentation

## Get An S3 Method

### Description

Get a method for an S3 generic, possibly from a namespace.

### Usage

    getS3method(f, class, optional = FALSE)

### Arguments

`f` | character: name of the generic.
`class` | character: name of the class.
`optional` | logical: should failure to find the generic or a method be allowed?

### Details

S3 methods may be hidden in packages with namespaces, and will not then be found by `get`: this function can retrieve such functions, primarily for debugging purposes.

### Value

The function found, or `NULL` if no function is found and `optional = TRUE`.

### See Also

`methods`, `get`

### Examples

    require(stats)
    exists("predict.ppr") # false
    getS3method("predict", "ppr")

[Package utils version 2.3.1 Index]