\HeaderA{list2Matrix}{A function that takes a named list representation of a bipartite graph 
and transforms it into a matrix representation.}{list2Matrix}
\keyword{models}{list2Matrix}
\begin{Description}\relax
The \code{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.
\end{Description}
\begin{Usage}
\begin{verbatim}
list2Matrix(namedList, type="interaction")
\end{verbatim}
\end{Usage}
\begin{Arguments}
\begin{ldescription}
\item[\code{namedList}] A named list. The list represents a bipartite graph.
\item[\code{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
\end{ldescription}
\end{Arguments}
\begin{Value}
A (0,1)-matrix representation of the bipartite graph.
\end{Value}
\begin{Author}\relax
T Chiang
\end{Author}
\begin{Examples}
\begin{ExampleCode}
eg = list(first = letters[1:5], second = letters[4:8])
list2Matrix(eg)
\end{ExampleCode}
\end{Examples}

