FunctionGenerator {tm}R Documentation

Function Generator

Description

Construct a function generator.

Usage

FunctionGenerator(x)

Arguments

x

A generator function which takes some input and constructs and returns a new function based on that input information.

Value

An object of class FunctionGenerator which extends the class function representing a function generator.

Author(s)

Ingo Feinerer

See Also

Most reader functions (use getReaders to list available readers) are function generators.

Examples

funGen <- FunctionGenerator(function(y, ...) {
if (is(y, "integer")) function(x) x+1 else function(x) x-1
})
funGen
funGen(3L)
funGen("a")

[Package tm version 0.5-10 Index]