EVOLUTION-MANAGER
Edit File: each_edge.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: Rewires the endpoints of the edges of a graph to a random...</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 each_edge {igraph}"><tr><td>each_edge {igraph}</td><td style="text-align: right;">R Documentation</td></tr></table> <h2>Rewires the endpoints of the edges of a graph to a random vertex</h2> <h3>Description</h3> <p>This function can be used together with <code><a href="rewire.html">rewire</a></code>. This method rewires the endpoints of the edges with a constant probability uniformly randomly to a new vertex in a graph. </p> <h3>Usage</h3> <pre> each_edge( prob, loops = FALSE, multiple = FALSE, mode = c("all", "out", "in", "total") ) </pre> <h3>Arguments</h3> <table summary="R argblock"> <tr valign="top"><td><code>prob</code></td> <td> <p>The rewiring probability, a real number between zero and one.</p> </td></tr> <tr valign="top"><td><code>loops</code></td> <td> <p>Logical scalar, whether loop edges are allowed in the rewired graph.</p> </td></tr> <tr valign="top"><td><code>multiple</code></td> <td> <p>Logical scalar, whether multiple edges are allowed in the generated graph.</p> </td></tr> <tr valign="top"><td><code>mode</code></td> <td> <p>Character string, specifies which endpoint of the edges to rewire in directed graphs. ‘all’ rewires both endpoints, ‘in’ rewires the start (tail) of each directed edge, ‘out’ rewires the end (head) of each directed edge. Ignored for undirected graphs.</p> </td></tr> </table> <h3>Details</h3> <p>Note that this method might create graphs with multiple and/or loop edges. </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>Other rewiring functions: <code><a href="keeping_degseq.html">keeping_degseq</a>()</code>, <code><a href="rewire.html">rewire</a>()</code> </p> <h3>Examples</h3> <pre> # Some random shortcuts shorten the distances on a lattice g <- make_lattice(length = 100, dim = 1, nei = 5) mean_distance(g) g <- rewire(g, each_edge(prob = 0.05)) mean_distance(g) # Rewiring the start of each directed edge preserves the in-degree distribution # but not the out-degree distribution g <- barabasi.game(1000) g2 <- g %>% rewire(each_edge(mode="in", multiple=TRUE, prob=0.2)) degree(g, mode="in") == degree(g2, mode="in") </pre> <hr /><div style="text-align: center;">[Package <em>igraph</em> version 1.3.5 <a href="00Index.html">Index</a>]</div> </body></html>