nwsStore                 package:nws                 R Documentation

_A_s_s_o_c_i_a_t_e _a _V_a_l_u_e _w_i_t_h _a _V_a_r_i_a_b_l_e _i_n _n_e_t_W_o_r_k_S_p_a_c_e

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

     Store value associated with a variable in the shared netWorkSpace.

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

     ## S4 method for signature 'netWorkSpace':
     nwsStore(.Object, xName, xVal)

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

 .Object: a netWorkSpace class object.

   xName: character string to be used as the name of the stored
          variable.

    xVal: value to be stored.

_D_e_t_a_i_l_s:

     The 'nwsStore' method associates the value 'xVal' with the 
     variable 'xName' in the shared netWorkSpace '.Object', thereby
     making the value available to all the distributed R processes.  If
     a mode has not already been set for 'xName', ''fifo'' will be used
     (see 'nwsDeclare').

     Note that, by default (''fifo'' mode), 'nwsStore' is not
     idempotent:  repeating 'nwsStore (nws, xName, xVal)' will add
     additional values to the  set of values associated with the
     variable named 'xName'. See the examples below for details.

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

     'nwsDeclare'

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

     ## Not run: 
     ws <- netWorkSpace('nws example')

     # To store value 5 bound to variable 'x' on the netWorkSpace 'ws'
     # (If 'x' was declared, then its mode is inherited, 
     # otherwise 'x' uses the default mode 'fifo')
     nwsStore(ws, 'x', 5)

     # store 10 values associate with variable y to the netWorkSpace
     for (i in 1:10)
       nwsStore(ws, 'y', i)

     # retrieve 10 values associate with variable y from the netWorkSpace
     for (i in 1:10)
       print(nwsFetch(ws, 'y'))
     ## End(Not run)

