EVOLUTION-MANAGER
Edit File: sample_traits_callaway.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: Graph generation based on different vertex types</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 sample_traits_callaway {igraph}"><tr><td>sample_traits_callaway {igraph}</td><td style="text-align: right;">R Documentation</td></tr></table> <h2>Graph generation based on different vertex types</h2> <h3>Description</h3> <p>These functions implement evolving network models based on different vertex types. </p> <h3>Usage</h3> <pre> sample_traits_callaway( nodes, types, edge.per.step = 1, type.dist = rep(1, types), pref.matrix = matrix(1, types, types), directed = FALSE ) traits_callaway(...) sample_traits( nodes, types, k = 1, type.dist = rep(1, types), pref.matrix = matrix(1, types, types), directed = FALSE ) traits(...) </pre> <h3>Arguments</h3> <table summary="R argblock"> <tr valign="top"><td><code>nodes</code></td> <td> <p>The number of vertices in the graph.</p> </td></tr> <tr valign="top"><td><code>types</code></td> <td> <p>The number of different vertex types.</p> </td></tr> <tr valign="top"><td><code>edge.per.step</code></td> <td> <p>The number of edges to add to the graph per time step.</p> </td></tr> <tr valign="top"><td><code>type.dist</code></td> <td> <p>The distribution of the vertex types. This is assumed to be stationary in time.</p> </td></tr> <tr valign="top"><td><code>pref.matrix</code></td> <td> <p>A matrix giving the preferences of the given vertex types. These should be probabilities, ie. numbers between zero and one.</p> </td></tr> <tr valign="top"><td><code>directed</code></td> <td> <p>Logical constant, whether to generate directed graphs.</p> </td></tr> <tr valign="top"><td><code>...</code></td> <td> <p>Passed to the constructor, <code>sample_traits</code> or <code>sample_traits_callaway</code>.</p> </td></tr> <tr valign="top"><td><code>k</code></td> <td> <p>The number of trials per time step, see details below.</p> </td></tr> </table> <h3>Details</h3> <p>For <code>sample_traits_callaway</code> the simulation goes like this: in each discrete time step a new vertex is added to the graph. The type of this vertex is generated based on <code>type.dist</code>. Then two vertices are selected uniformly randomly from the graph. The probability that they will be connected depends on the types of these vertices and is taken from <code>pref.matrix</code>. Then another two vertices are selected and this is repeated <code>edges.per.step</code> times in each time step. </p> <p>For <code>sample_traits</code> the simulation goes like this: a single vertex is added at each time step. This new vertex tries to connect to <code>k</code> vertices in the graph. The probability that such a connection is realized depends on the types of the vertices involved and is taken from <code>pref.matrix</code>. </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> # two types of vertices, they like only themselves g1 <- sample_traits_callaway(1000, 2, pref.matrix=matrix( c(1,0,0,1), ncol=2)) g2 <- sample_traits(1000, 2, k=2, pref.matrix=matrix( c(1,0,0,1), ncol=2)) </pre> <hr /><div style="text-align: center;">[Package <em>igraph</em> version 1.3.5 <a href="00Index.html">Index</a>]</div> </body></html>