EVOLUTION-MANAGER
Edit File: Recall.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: Recursive Calling</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 Recall {base}"><tr><td>Recall {base}</td><td style="text-align: right;">R Documentation</td></tr></table> <h2>Recursive Calling</h2> <h3>Description</h3> <p><code>Recall</code> is used as a placeholder for the name of the function in which it is called. It allows the definition of recursive functions which still work after being renamed, see example below. </p> <h3>Usage</h3> <pre> Recall(...) </pre> <h3>Arguments</h3> <table summary="R argblock"> <tr valign="top"><td><code>...</code></td> <td> <p>all the arguments to be passed.</p> </td></tr> </table> <h3>Note</h3> <p><code>Recall</code> will not work correctly when passed as a function argument, e.g. to the <code>apply</code> family of functions. </p> <h3>See Also</h3> <p><code><a href="do.call.html">do.call</a></code> and <code><a href="call.html">call</a></code>. </p> <p><code><a href="eval.html">local</a></code> for another way to write anonymous recursive functions. </p> <h3>Examples</h3> <pre> ## A trivial (but inefficient!) example: fib <- function(n) if(n<=2) { if(n>=0) 1 else 0 } else Recall(n-1) + Recall(n-2) fibonacci <- fib; rm(fib) ## renaming wouldn't work without Recall fibonacci(10) # 55 </pre> <hr /><div style="text-align: center;">[Package <em>base</em> version 3.6.0 <a href="00Index.html">Index</a>]</div> </body></html>