Description Usage Arguments Value Examples
Easily Build Function Factories
1 | build_factory(fun, ...)
|
fun |
An anonymous function to turn into a factory. |
... |
Arguments for the factory function. Things on the RHS will be
evaluated before building your factory unless explicitly quoted with
|
A function factory.
1 2 3 4 5 6 7 8 9 10 11 | y <- 2
power <- build_factory(
fun = function(x) {
x^exponent
},
exponent
)
square <- power(y)
square(2)
y <- 7
square(2)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.