Recall(...)
Recall
finds the definition of the function from which it
is being called, and recursively calls that function with
the arguments supplied to
Recall
.
The recursion does not depend on the name of the function.
The
Recall
function also makes it possible to define a recursive function
inside of another function.
To execute a deeply recursive function you may need to increase options("expressions") above its default level of 256. If options("expressions") is not large enough you will see the message "Error: Expressions nested beyond limit (256)". Recall() uses one more frame and one more level of expression nesting than the direct recursive call of your function by name, so you may have to increase options("expressions") to allow for that.
# recursive factorial function fact <- function(x) if(x<=1) x else x * Recall(x-1) fact(x)