Learn R Programming

nws (version 1.6.2)

export: sleigh Class Method

Description

Define a variable in the scope of the workers or specified worker.

Usage

## S3 method for class 'sleigh':
export(.Object, xName, xVal, worker=NULL)

Arguments

.Object
a sleigh class object.
xName
a variable name (given as a quoted string in the function call).
xVal
a value to be assigned to 'x'.
worker
integer rank of the worker where the variable is defined. The rank values range from 0 to workerCount - 1. By default, the variable is defined on all workers in the sleigh.

See Also

unexport

Examples

Run this code
s <- sleigh()
m <- matrix(rnorm(16), 4, 4)
export(s, 'm', m)
eachWorker(s, function() m %*% matrix(rnorm(16), 4, 4), eo=list(closure=FALSE))

Run the code above in your browser using DataLab