Description Usage Arguments Examples
A trampoline is a function or set of functions that together give us the tools we need to write code in a recursive style, in a way that doesn't overflow the stack. Here's an awesome trampoline by Jim Hester:
1 | trampoline(f, ...)
|
f |
A function. |
... |
Any number of named or unnamed arguments. |
1 2 3 4 5 | countdown <- trampoline(function(n) {
if (n > 0) recur(n-1) else "done"
})
countdown(10000)
[1] "done"
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.