list2Matrix             package:Rintact             R Documentation

_A _f_u_n_c_t_i_o_n _t_h_a_t _t_a_k_e_s _a _n_a_m_e_d _l_i_s_t _r_e_p_r_e_s_e_n_t_a_t_i_o_n _o_f _a _b_i_p_a_r_t_i_t_e _g_r_a_p_h 
_a_n_d _t_r_a_n_s_f_o_r_m_s _i_t _i_n_t_o _a _m_a_t_r_i_x _r_e_p_r_e_s_e_n_t_a_t_i_o_n.

_D_e_s_c_r_i_p_t_i_o_n:

     The 'list2Matrix' takes in a named list (representing a bipartite
     graph) and transforms into into a (0,1)-matrix representation. The
     names of the list index the  columns and the union of the elements
     of the list index the row. The (i,j) position of the matrix is 1
     if element i is in the list element indexed by name j, and it  is
     0 otherwise.

_U_s_a_g_e:

     list2Matrix(namedList, type="interaction")

_A_r_g_u_m_e_n_t_s:

namedList: A named list. The list represents a bipartite graph.

    type: If type is "interaction", the return value is a bait-prey
          adjacency matrix with baits indexing the columns and prey
          indexing rows. If type is "complex", the return value is an
          incidence matrix with complexes indexing the columns and
          proteins indexing the rows

_V_a_l_u_e:

     A (0,1)-matrix representation of the bipartite graph.

_A_u_t_h_o_r(_s):

     T Chiang

_E_x_a_m_p_l_e_s:

     eg = list(first = letters[1:5], second = letters[4:8])
     list2Matrix(eg)

