MC | R Documentation |
MC makes closures for defining functions in a function.
MC(f, env=NULL)
f |
function |
env |
a list containing functions to be used in f |
MC declares functions to be used in f. When f is defined inside of a function, say fun, it cannot call other functions defined in fun. MC can enclose the functions needed by f and make it possible for f to call other functions defined in fun.
Knut M. Wittkowski kmw@rockefeller.edu
f1 <- function(x, y) x+y
f2 <- MC(function(x, y) x*y, list(f1=f1))
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.