powered by
Easily Build Function Factories
build_factory(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 quote. See examples.
quote
A function factory.
# NOT RUN { y <- 2 power <- build_factory( fun = function(x) { x^exponent }, exponent ) square <- power(y) square(2) y <- 7 square(2) # }
Run the code above in your browser using DataLab