orch.export

Makes R objects from a user's local R session available in the Hadoop execution environment, so that they can be referenced in MapReduce jobs.

Usage

orch.export(...)

Arguments

. . .

One or more variables, data frames, or other in-memory objects, by name or as an explicit definition, in a comma-separated list.

Usage Notes

You can use this function to prepare local variables for use in hadoop.exec and hadoop.run functions. The mapper, reducer, combiner, init, and final arguments can reference the exported variables.

Return Value

A list object

Example

This code fragment shows orch.export used in the export argument of the hadoop.run function:

hadoop.run(x,
    export = orch.export(a=1, b=2),
    mapper = function(k,v) {
        x <- a + b
        orch.keyval(key=NULL, val=x)
    }
)

The following is a similar code fragment, except that the variables are defined outside the hadoop.run function:

a=1
b=2
hadoop.run(x,
    export = orch.export(a, b),
    .
    .
    .
)