Recall
Recursive Call of the Current Function

Description

Makes a recursive call to the current function, so that the definition of a recursive function is independent of its name.

Usage

Recall(...)

Arguments

... the arguments that should be passed in to the recursive call.

Details

The Recall function reuses the definition of the function that called it and then recursively calls that function while applying the supplied arguments. The recursion is not dependent on the name of the function. You can use the Recall function to define a recursive function inside another function.
Value
Whatever the current function returns.
See Also
Syntax.
Examples
# recursive factorial function
fact <- function(x) if(x <= 1) x else x * Recall(x-1)
fact(x)
Package base version 6.1.1-7
Package Index