addTemp                package:svMisc                R Documentation

_A_d_d _d_a_t_a _t_o _a_n _i_t_e_m _i_n _a _t_e_m_p_o_r_a_r_y _l_i_s_t _v_a_r_i_a_b_l_e

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

     The function adds data to an item in a list variable located in
     TempEnv, an environment dedicated to temporary variables
     (especially useful for GUIs).

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

     addTemp(x, item, value, use.names = TRUE, replace = TRUE)

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

       x: The name of the variable containing the list 

    item: The item to add data to in the list 

   value: The value to add in the item, it must be a named vector and
          element matching is done according to name of items 

use.names: Do we match items in the existing vector and the vector we
          add by means of its names or its values?

 replace: Do we replace existing items? 

_A_u_t_h_o_r(_s):

     Philippe Grosjean <phgrosjean@sciviews.org>

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

     'TempEnv', 'assignTemp', 'getTemp', 'existsTemp', 'rmTemp',
     'changeTemp', 'tempvar'

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

     addTemp("tst", "item1", c(a = 1, b = 2))
     # Retrieve this variable
     getTemp("tst")
     # Add to item1 in this list without replacement
     addTemp("tst", "item1", c(a = 45, c = 3), replace = FALSE)
     getTemp("tst")
     # Same but with replacement of existing items
     addTemp("tst", "item1", c(a = 45, c = 3), replace = TRUE)
     getTemp("tst")
     # Delete the whole variable
     rmTemp("tst")

