nwsDeclare                package:nws                R Documentation

_n_e_t_W_o_r_k_S_p_a_c_e _C_l_a_s_s _M_e_t_h_o_d

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

     Declare a variable with particular mode in a shared netWorkSpace.

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

       nwsDeclare(.Object, xName, mode)

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

 .Object: a netWorkSpace class object

   xName: name of variable to be declared

    mode: mode of the variable, see details

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

     If xName has not already been declared in the netWorkSpace, the
     behavior of xName will be determined by mode. Mode can be 'fifo',
     'lifo', 'multi', or 'single'. In the first three cases, multiple
     values can be associated with xName. When a value is retrieved for
     xName, the oldest value stored will be used in 'fifo' mode, the
     youngest in 'lifo' mode, and a nondeterministic choice will be
     made in 'multi' mode. In 'single' mode, only the most recent value
     is retained.

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

     ## Not run: 
     ws <- netWorkSpace('nws example')
     nwsDeclare(ws, 'pi', 'single')
     nwsStore(ws, 'pi', 2.171828182)
     nwsStore(ws, 'pi', 3.141592654)

     # nwsListVars(ws) will show that only the most recent value of pi is retained
     ## End(Not run)

