EVOLUTION-MANAGER
Edit File: intersection.igraph.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: Intersection 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 intersection.igraph {igraph}"><tr><td>intersection.igraph {igraph}</td><td style="text-align: right;">R Documentation</td></tr></table> <h2>Intersection of graphs</h2> <h3>Description</h3> <p>The intersection of two or more graphs are created. The graphs may have identical or overlapping vertex sets. </p> <h3>Usage</h3> <pre> ## S3 method for class 'igraph' intersection(..., byname = "auto", keep.all.vertices = TRUE) </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>byname</code></td> <td> <p>A logical scalar, or the character scalar <code>auto</code>. Whether to perform the operation based on symbolic vertex names. If it is <code>auto</code>, that means <code>TRUE</code> if all graphs are named and <code>FALSE</code> otherwise. A warning is generated if <code>auto</code> and some (but not all) graphs are named.</p> </td></tr> <tr valign="top"><td><code>keep.all.vertices</code></td> <td> <p>Logical scalar, whether to keep vertices that only appear in a subset of the input graphs.</p> </td></tr> </table> <h3>Details</h3> <p><code>intersection</code> creates the intersection of two or more graphs: only edges present in all graphs will be included. The corresponding operator is %s%. </p> <p>If the <code>byname</code> argument is <code>TRUE</code> (or <code>auto</code> and all graphs are named), then the operation is performed on symbolic vertex names instead of the internal numeric vertex ids. </p> <p><code>intersection</code> keeps the attributes of all graphs. All graph, vertex and edge attributes are copied to the result. If an attribute is present in multiple graphs and would result a name clash, then this attribute is renamed by adding suffixes: _1, _2, etc. </p> <p>The <code>name</code> vertex attribute is treated specially if the operation is performed based on symbolic vertex names. In this case <code>name</code> must be present in all graphs, and it is not renamed in the result graph. </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> ## Common part of two social networks net1 <- graph_from_literal(D-A:B:F:G, A-C-F-A, B-E-G-B, A-B, F-G, H-F:G, H-I-J) net2 <- graph_from_literal(D-A:F:Y, B-A-X-F-H-Z, F-Y) print_all(net1 %s% net2) </pre> <hr /><div style="text-align: center;">[Package <em>igraph</em> version 1.3.5 <a href="00Index.html">Index</a>]</div> </body></html>