EVOLUTION-MANAGER
Edit File: as_incidence_matrix.html
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"><html xmlns="http://www.w3.org/1999/xhtml"><head><title>R: Incidence matrix of a bipartite graph</title> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <link rel="stylesheet" type="text/css" href="R.css" /> </head><body> <table width="100%" summary="page for as_incidence_matrix {igraph}"><tr><td>as_incidence_matrix {igraph}</td><td style="text-align: right;">R Documentation</td></tr></table> <h2>Incidence matrix of a bipartite graph</h2> <h3>Description</h3> <p>This function can return a sparse or dense incidence matrix of a bipartite network. The incidence matrix is an <i>n</i> times <i>m</i> matrix, <i>n</i> and <i>m</i> are the number of vertices of the two kinds. </p> <h3>Usage</h3> <pre> as_incidence_matrix( graph, types = NULL, attr = NULL, names = TRUE, sparse = FALSE ) </pre> <h3>Arguments</h3> <table summary="R argblock"> <tr valign="top"><td><code>graph</code></td> <td> <p>The input graph. The direction of the edges is ignored in directed graphs.</p> </td></tr> <tr valign="top"><td><code>types</code></td> <td> <p>An optional vertex type vector to use instead of the <code>type</code> vertex attribute. You must supply this argument if the graph has no <code>type</code> vertex attribute.</p> </td></tr> <tr valign="top"><td><code>attr</code></td> <td> <p>Either <code>NULL</code> or a character string giving an edge attribute name. If <code>NULL</code>, then a traditional incidence matrix is returned. If not <code>NULL</code> then the values of the given edge attribute are included in the incidence matrix. If the graph has multiple edges, the edge attribute of an arbitrarily chosen edge (for the multiple edges) is included.</p> </td></tr> <tr valign="top"><td><code>names</code></td> <td> <p>Logical scalar, if <code>TRUE</code> and the vertices in the graph are named (i.e. the graph has a vertex attribute called <code>name</code>), then vertex names will be added to the result as row and column names. Otherwise the ids of the vertices are used as row and column names.</p> </td></tr> <tr valign="top"><td><code>sparse</code></td> <td> <p>Logical scalar, if it is <code>TRUE</code> then a sparse matrix is created, you will need the <code>Matrix</code> package for this.</p> </td></tr> </table> <h3>Details</h3> <p>Bipartite graphs have a <code>type</code> vertex attribute in igraph, this is boolean and <code>FALSE</code> for the vertices of the first kind and <code>TRUE</code> for vertices of the second kind. </p> <h3>Value</h3> <p>A sparse or dense matrix. </p> <h3>Author(s)</h3> <p>Gabor Csardi <a href="mailto:csardi.gabor@gmail.com">csardi.gabor@gmail.com</a> </p> <h3>See Also</h3> <p><code><a href="graph_from_incidence_matrix.html">graph_from_incidence_matrix</a></code> for the opposite operation. </p> <h3>Examples</h3> <pre> g <- make_bipartite_graph( c(0,1,0,1,0,0), c(1,2,2,3,3,4) ) as_incidence_matrix(g) </pre> <hr /><div style="text-align: center;">[Package <em>igraph</em> version 1.3.5 <a href="00Index.html">Index</a>]</div> </body></html>