EVOLUTION-MANAGER
Edit File: igraph-minus.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: Delete vertices or edges from a 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 igraph-minus {igraph}"><tr><td>igraph-minus {igraph}</td><td style="text-align: right;">R Documentation</td></tr></table> <h2>Delete vertices or edges from a graph</h2> <h3>Description</h3> <p>Delete vertices or edges from a graph </p> <h3>Usage</h3> <pre> ## S3 method for class 'igraph' e1 - e2 </pre> <h3>Arguments</h3> <table summary="R argblock"> <tr valign="top"><td><code>e1</code></td> <td> <p>Left argument, see details below.</p> </td></tr> <tr valign="top"><td><code>e2</code></td> <td> <p>Right argument, see details below.</p> </td></tr> </table> <h3>Details</h3> <p>The minus operator (‘<code>-</code>’) can be used to remove vertices or edges from the graph. The operation performed is selected based on the type of the right hand side argument: </p> <ul> <li><p> If it is an igraph graph object, then the difference of the two graphs is calculated, see <code><a href="difference.html">difference</a></code>. </p> </li> <li><p> If it is a numeric or character vector, then it is interpreted as a vector of vertex ids and the specified vertices will be deleted from the graph. Example: </p> <pre> g <- make_ring(10) V(g)$name <- letters[1:10] g <- g - c("a", "b")</pre> </li> <li><p> If <code>e2</code> is a vertex sequence (e.g. created by the <code><a href="V.html">V</a></code> function), then these vertices will be deleted from the graph. </p> </li> <li><p> If it is an edge sequence (e.g. created by the <code><a href="E.html">E</a></code> function), then these edges will be deleted from the graph. </p> </li> <li><p> If it is an object created with the <code><a href="vertex.html">vertex</a></code> (or the <code><a href="vertex.html">vertices</a></code>) function, then all arguments of <code><a href="vertex.html">vertices</a></code> are concatenated and the result is interpreted as a vector of vertex ids. These vertices will be removed from the graph. </p> </li> <li><p> If it is an object created with the <code><a href="edge.html">edge</a></code> (or the <code><a href="edge.html">edges</a></code>) function, then all arguments of <code><a href="edge.html">edges</a></code> are concatenated and then interpreted as edges to be removed from the graph. Example: </p> <pre> g <- make_ring(10) V(g)$name <- letters[1:10] E(g)$name <- LETTERS[1:10] g <- g - edge("e|f") g <- g - edge("H")</pre> </li> <li><p> If it is an object created with the <code><a href="path.html">path</a></code> function, then all <code><a href="path.html">path</a></code> arguments are concatenated and then interpreted as a path along which edges will be removed from the graph. Example: </p> <pre> g <- make_ring(10) V(g)$name <- letters[1:10] g <- g - path("a", "b", "c", "d")</pre> </li></ul> <h3>Value</h3> <p>An igraph graph. </p> <h3>See Also</h3> <p>Other functions for manipulating graph structure: <code><a href="plus-.igraph.html">+.igraph</a>()</code>, <code><a href="add_edges.html">add_edges</a>()</code>, <code><a href="add_vertices.html">add_vertices</a>()</code>, <code><a href="delete_edges.html">delete_edges</a>()</code>, <code><a href="delete_vertices.html">delete_vertices</a>()</code>, <code><a href="edge.html">edge</a>()</code>, <code><a href="path.html">path</a>()</code>, <code><a href="vertex.html">vertex</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>