powered by
Put a function in a "lean" environment that does not carry unnecessary baggage with it (e.g. references to datasets).
crate(.fn, ..., .parent = .GlobalEnv)
(function()) function to crate
function()
(any) The objects, which should be visible inside .fn.
.fn
(environment) Parent environment to look up names. Default so the global environment.
environment
# NOT RUN { meta_f = function(z) { x = 1 y = 2 crate(function() { c(x, y, z) }, x) } x = 100 y = 200 z = 300 f = meta_f(1) f() # }
Run the code above in your browser using DataLab