EVOLUTION-MANAGER
Edit File: getS3method.html
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"><html xmlns="http://www.w3.org/1999/xhtml"><head><title>R: Get an S3 Method</title> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <link rel="stylesheet" type="text/css" href="R.css" /> </head><body> <table width="100%" summary="page for getS3method {utils}"><tr><td>getS3method {utils}</td><td style="text-align: right;">R Documentation</td></tr></table> <h2>Get an S3 Method</h2> <h3>Description</h3> <p>Get a method for an S3 generic, possibly from a namespace or the generic's registry. </p> <h3>Usage</h3> <pre> getS3method(f, class, optional = FALSE, envir = parent.frame()) </pre> <h3>Arguments</h3> <table summary="R argblock"> <tr valign="top"><td><code>f</code></td> <td> <p>character: name of the generic.</p> </td></tr> <tr valign="top"><td><code>class</code></td> <td> <p>character: name of the class.</p> </td></tr> <tr valign="top"><td><code>optional</code></td> <td> <p>logical: should failure to find the generic or a method be allowed?</p> </td></tr> <tr valign="top"><td><code>envir</code></td> <td> <p>the <code><a href="../../base/html/environment.html">environment</a></code> in which the method and its generic are searched first.</p> </td></tr> </table> <h3>Details</h3> <p>S3 methods may be hidden in namespaces, and will not then be found by <code><a href="../../base/html/get.html">get</a></code>: this function can retrieve such functions, primarily for debugging purposes. </p> <p>Further, S3 methods can be registered on the generic when a namespace is loaded, and the registered method will be used if none is visible (using namespace scoping rules). </p> <p>It is possible that which S3 method will be used may depend on where the generic <code>f</code> is called from: <code>getS3method</code> returns the method found if <code>f</code> were called from the same environment. </p> <h3>Value</h3> <p>The function found, or <code>NULL</code> if no function is found and <code>optional = TRUE</code>. </p> <h3>See Also</h3> <p><code><a href="methods.html">methods</a></code>, <code><a href="../../base/html/get.html">get</a></code>, <code><a href="getAnywhere.html">getAnywhere</a></code> </p> <h3>Examples</h3> <pre> require(stats) exists("predict.ppr") # false getS3method("predict", "ppr") </pre> <hr /><div style="text-align: center;">[Package <em>utils</em> version 3.6.0 <a href="00Index.html">Index</a>]</div> </body></html>