EVOLUTION-MANAGER
Edit File: setGroupGeneric.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: Create a Group Generic Version of a Function</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 setGroupGeneric {methods}"><tr><td>setGroupGeneric {methods}</td><td style="text-align: right;">R Documentation</td></tr></table> <h2>Create a Group Generic Version of a Function</h2> <h3>Description</h3> <p>The <code>setGroupGeneric</code> function behaves like <code><a href="setGeneric.html">setGeneric</a></code> except that it constructs a group generic function, differing in two ways from an ordinary generic function. First, this function cannot be called directly, and the body of the function created will contain a stop call with this information. Second, the group generic function contains information about the known members of the group, used to keep the members up to date when the group definition changes, through changes in the search list or direct specification of methods, etc. </p> <p>All members of the group must have the identical argument list. </p> <h3>Usage</h3> <pre> setGroupGeneric(name, def= , group=list(), valueClass=character(), knownMembers=list(), package= , where= ) </pre> <h3>Arguments</h3> <table summary="R argblock"> <tr valign="top"><td><code>name</code></td> <td> <p>the character string name of the generic function. </p> </td></tr> <tr valign="top"><td><code>def</code></td> <td> <p>A function object. There isn't likely to be an existing nongeneric of this name, so some function needs to be supplied. Any known member or other function with the same argument list will do, because the group generic cannot be called directly. </p> </td></tr> <tr valign="top"><td><code>group, valueClass</code></td> <td> <p>arguments to pass to <code><a href="setGeneric.html">setGeneric</a></code>. </p> </td></tr> <tr valign="top"><td><code>knownMembers</code></td> <td> <p>the names of functions that are known to be members of this group. This information is used to reset cached definitions of the member generics when information about the group generic is changed. </p> </td></tr> <tr valign="top"><td><code>package, where</code></td> <td> <p>passed to <code><a href="setGeneric.html">setGeneric</a></code>, but obsolete and to be avoided.</p> </td></tr> </table> <h3>Value</h3> <p>The <code>setGroupGeneric</code> function exists for its side effect: saving the generic function to allow methods to be specified later. It returns <code>name</code>. </p> <h3>References</h3> <p>Chambers, John M. (2016) <em>Extending R</em> Chapman & Hall </p> <h3>See Also</h3> <p><code><a href="Methods_Details.html">Methods_Details</a></code> and the links there for a general discussion, <code><a href="dotsMethods.html">dotsMethods</a></code> for methods that dispatch on <code>...</code>, and <code><a href="setMethod.html">setMethod</a></code> for method definitions. </p> <h3>Examples</h3> <pre> ## Not run: ## the definition of the "Logic" group generic in the methods package setGroupGeneric("Logic", function(e1, e2) NULL, knownMembers = c("&", "|")) ## End(Not run) </pre> <hr /><div style="text-align: center;">[Package <em>methods</em> version 3.6.0 <a href="00Index.html">Index</a>]</div> </body></html>