Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

MC

Make Closure for functions


Description

MC makes closures for defining functions in a function.

Usage

MC(f, env=NULL)

Arguments

f

function

env

a list containing functions to be used in f

Details

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.

Author(s)

Knut M. Wittkowski kmw@rockefeller.edu

Examples

f1 <- function(x, y) x+y
f2 <- MC(function(x, y) x*y, list(f1=f1))

splus2R

Supplemental S-PLUS Functionality in R

v1.3-3
GPL-2
Authors
William Constantine [aut], Tim Hesterberg [aut], Knut Wittkowski [ctb], Tingting Song [ctb], Bill Dunlap [ctb], Stephen Kaluzny [ctb, cre]
Initial release

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.