EVOLUTION-MANAGER
Edit File: disjoint_union.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: Disjoint union of graphs</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 disjoint_union {igraph}"><tr><td>disjoint_union {igraph}</td><td style="text-align: right;">R Documentation</td></tr></table> <h2>Disjoint union of graphs</h2> <h3>Description</h3> <p>The union of two or more graphs are created. The graphs are assumed to have disjoint vertex sets. </p> <h3>Usage</h3> <pre> disjoint_union(...) x %du% y </pre> <h3>Arguments</h3> <table summary="R argblock"> <tr valign="top"><td><code>...</code></td> <td> <p>Graph objects or lists of graph objects.</p> </td></tr> <tr valign="top"><td><code>x, y</code></td> <td> <p>Graph objects.</p> </td></tr> </table> <h3>Details</h3> <p><code>disjoint_union</code> creates a union of two or more disjoint graphs. Thus first the vertices in the second, third, etc. graphs are relabeled to have completely disjoint graphs. Then a simple union is created. This function can also be used via the %du% operator. </p> <p><code>graph.disjont.union</code> handles graph, vertex and edge attributes. In particular, it merges vertex and edge attributes using the basic <code>c()</code> function. For graphs that lack some vertex/edge attribute, the corresponding values in the new graph are set to <code>NA</code>. Graph attributes are simply copied to the result. If this would result a name clash, then they are renamed by adding suffixes: _1, _2, etc. </p> <p>Note that if both graphs have vertex names (ie. a <code>name</code> vertex attribute), then the concatenated vertex names might be non-unique in the result. A warning is given if this happens. </p> <p>An error is generated if some input graphs are directed and others are undirected. </p> <h3>Value</h3> <p>A new graph object. </p> <h3>Author(s)</h3> <p>Gabor Csardi <a href="mailto:csardi.gabor@gmail.com">csardi.gabor@gmail.com</a> </p> <h3>Examples</h3> <pre> ## A star and a ring g1 <- make_star(10, mode="undirected") V(g1)$name <- letters[1:10] g2 <- make_ring(10) V(g2)$name <- letters[11:20] print_all(g1 %du% g2) </pre> <hr /><div style="text-align: center;">[Package <em>igraph</em> version 1.3.5 <a href="00Index.html">Index</a>]</div> </body></html>