export                  package:nws                  R Documentation

_s_l_e_i_g_h _C_l_a_s_s _M_e_t_h_o_d

_D_e_s_c_r_i_p_t_i_o_n:

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

_U_s_a_g_e:

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

_A_r_g_u_m_e_n_t_s:

 .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.

_S_e_e _A_l_s_o:

     'unexport'

_E_x_a_m_p_l_e_s:

     ## Not run: 
     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))
     ## End(Not run)

