EVOLUTION-MANAGER
Edit File: sub-sub-.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: Query and manipulate a graph as it were an adjacency list</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 [[.igraph {igraph}"><tr><td>[[.igraph {igraph}</td><td style="text-align: right;">R Documentation</td></tr></table> <h2>Query and manipulate a graph as it were an adjacency list</h2> <h3>Description</h3> <p>Query and manipulate a graph as it were an adjacency list </p> <h3>Usage</h3> <pre> ## S3 method for class 'igraph' x[[i, j, from, to, ..., directed = TRUE, edges = FALSE, exact = TRUE]] </pre> <h3>Arguments</h3> <table summary="R argblock"> <tr valign="top"><td><code>x</code></td> <td> <p>The graph.</p> </td></tr> <tr valign="top"><td><code>i</code></td> <td> <p>Index, integer, character or logical, see details below.</p> </td></tr> <tr valign="top"><td><code>j</code></td> <td> <p>Index, integer, character or logical, see details below.</p> </td></tr> <tr valign="top"><td><code>from</code></td> <td> <p>A numeric or character vector giving vertex ids or names. Together with the <code>to</code> argument, it can be used to query/set a sequence of edges. See details below. This argument cannot be present together with any of the <code>i</code> and <code>j</code> arguments and if it is present, then the <code>to</code> argument must be present as well.</p> </td></tr> <tr valign="top"><td><code>to</code></td> <td> <p>A numeric or character vector giving vertex ids or names. Together with the <code>from</code> argument, it can be used to query/set a sequence of edges. See details below. This argument cannot be present together with any of the <code>i</code> and <code>j</code> arguments and if it is present, then the <code>from</code> argument must be present as well.</p> </td></tr> <tr valign="top"><td><code>...</code></td> <td> <p>Additional arguments are not used currently.</p> </td></tr> <tr valign="top"><td><code>directed</code></td> <td> <p>Logical scalar, whether to consider edge directions in directed graphs. It is ignored for undirected graphs.</p> </td></tr> <tr valign="top"><td><code>edges</code></td> <td> <p>Logical scalar, whether to return edge ids.</p> </td></tr> <tr valign="top"><td><code>exact</code></td> <td> <p>Ignored.</p> </td></tr> </table> <h3>Details</h3> <p>The double bracket operator indexes the (imaginary) adjacency list of the graph. This can used for the following operations: </p> <ol> <li><p> Querying the adjacent vertices for one or more vertices: </p> <pre> graph[[1:3,]] graph[[,1:3]]</pre> <p>The first form gives the successors, the second the predecessors or the 1:3 vertices. (For undirected graphs they are equivalent.) </p> </li> <li><p> Querying the incident edges for one or more vertices, if the <code>edges</code> argument is set to <code>TRUE</code>: </p> <pre> graph[[1:3, , edges=TRUE]] graph[[, 1:3, edges=TRUE]]</pre> </li> <li><p> Querying the edge ids between two sets or vertices, if both indices are used. E.g. </p> <pre> graph[[v, w, edges=TRUE]]</pre> <p>gives the edge ids of all the edges that exist from vertices <i>v</i> to vertices <i>w</i>. </p> </li></ol> <p>The alternative argument names <code>from</code> and <code>to</code> can be used instead of the usual <code>i</code> and <code>j</code>, to make the code more readable: </p> <pre> graph[[from = 1:3]] graph[[from = v, to = w, edges = TRUE]]</pre> <p>‘<code>[[</code>’ operators allows logical indices and negative indices as well, with the usual R semantics. </p> <p>Vertex names are also supported, so instead of a numeric vertex id a vertex can also be given to ‘<code>[</code>’ and ‘<code>[[</code>’. </p> <h3>See Also</h3> <p>Other structural queries: <code><a href="sub-.igraph.html">[.igraph</a>()</code>, <code><a href="adjacent_vertices.html">adjacent_vertices</a>()</code>, <code><a href="are_adjacent.html">are_adjacent</a>()</code>, <code><a href="ends.html">ends</a>()</code>, <code><a href="get.edge.ids.html">get.edge.ids</a>()</code>, <code><a href="gorder.html">gorder</a>()</code>, <code><a href="gsize.html">gsize</a>()</code>, <code><a href="head_of.html">head_of</a>()</code>, <code><a href="incident_edges.html">incident_edges</a>()</code>, <code><a href="incident.html">incident</a>()</code>, <code><a href="is_directed.html">is_directed</a>()</code>, <code><a href="neighbors.html">neighbors</a>()</code>, <code><a href="tail_of.html">tail_of</a>()</code> </p> <hr /><div style="text-align: center;">[Package <em>igraph</em> version 1.3.5 <a href="00Index.html">Index</a>]</div> </body></html>