reverseSplit             package:Biobase             R Documentation

_A _f_u_n_c_t_i_o_n _t_o _r_e_v_e_r_s_e _t_h_e _r_o_l_e _o_f _n_a_m_e_s _a_n_d _v_a_l_u_e_s _i_n _a _l_i_s_t.

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

     Given a list with names 'x' and values in a set 'y' this function
     returns a list with names in 'y' and values in 'x'.

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

     reverseSplit(inList)

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

  inList: A named list with values that are vectors. 

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

     First the list is unrolled to provide a two long vectors, names
     are repeated, once for each of their values. Then the names are
     'split' by the values.

     This turns out to be useful for inverting mappings between one set
     of  identifiers and an other.

_V_a_l_u_e:

     A list with length equal to the number of distinct values in the
     input list and values from the names of the input list.

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

     R. Gentleman

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

     'split'

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

      l1 = list(a=1:4, b=c(2,3), d=c(4,5))
      reverseSplit(l1)

