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)

