EVOLUTION-MANAGER
Edit File: local_scan.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: Compute local scan statistics on 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 local_scan {igraph}"><tr><td>local_scan {igraph}</td><td style="text-align: right;">R Documentation</td></tr></table> <h2>Compute local scan statistics on graphs</h2> <h3>Description</h3> <p>The scan statistic is a summary of the locality statistics that is computed from the local neighborhood of each vertex. The <code>local_scan</code> function computes the local statistics for each vertex for a given neighborhood size and the statistic function. </p> <h3>Usage</h3> <pre> local_scan( graph.us, graph.them = NULL, k = 1, FUN = NULL, weighted = FALSE, mode = c("out", "in", "all"), neighborhoods = NULL, ... ) </pre> <h3>Arguments</h3> <table summary="R argblock"> <tr valign="top"><td><code>graph.us, graph</code></td> <td> <p>An igraph object, the graph for which the scan statistics will be computed</p> </td></tr> <tr valign="top"><td><code>graph.them</code></td> <td> <p>An igraph object or <code>NULL</code>, if not <code>NULL</code>, then the ‘them’ statistics is computed, i.e. the neighborhoods calculated from <code>graph.us</code> are evaluated on <code>graph.them</code>.</p> </td></tr> <tr valign="top"><td><code>k</code></td> <td> <p>An integer scalar, the size of the local neighborhood for each vertex. Should be non-negative.</p> </td></tr> <tr valign="top"><td><code>FUN</code></td> <td> <p>Character, a function name, or a function object itself, for computing the local statistic in each neighborhood. If <code>NULL</code>(the default value), <code>ecount</code> is used for unweighted graphs (if <code>weighted=FALSE</code>) and a function that computes the sum of edge weights is used for weighted graphs (if <code>weighted=TRUE</code>). This argument is ignored if <code>k</code> is zero.</p> </td></tr> <tr valign="top"><td><code>weighted</code></td> <td> <p>Logical scalar, TRUE if the edge weights should be used for computation of the scan statistic. If TRUE, the graph should be weighted. Note that this argument is ignored if <code>FUN</code> is not <code>NULL</code>, <code>"ecount"</code> and <code>"sumweights"</code>.</p> </td></tr> <tr valign="top"><td><code>mode</code></td> <td> <p>Character scalar, the kind of neighborhoods to use for the calculation. One of ‘<code>out</code>’, ‘<code>in</code>’, ‘<code>all</code>’ or ‘<code>total</code>’. This argument is ignored for undirected graphs.</p> </td></tr> <tr valign="top"><td><code>neighborhoods</code></td> <td> <p>A list of neighborhoods, one for each vertex, or <code>NULL</code>. If it is not <code>NULL</code>, then the function is evaluated on the induced subgraphs specified by these neighborhoods. </p> <p>In theory this could be useful if the same <code>graph.us</code> graph is used for multiple <code>graph.them</code> arguments. Then the neighborhoods can be calculated on <code>graph.us</code> and used with multiple graphs. In practice, this is currently slower than simply using <code>graph.them</code> multiple times.</p> </td></tr> <tr valign="top"><td><code>...</code></td> <td> <p>Arguments passed to <code>FUN</code>, the function that computes the local statistics.</p> </td></tr> </table> <h3>Details</h3> <p>See the given reference below for the details on the local scan statistics. </p> <p><code>local_scan</code> calculates exact local scan statistics. </p> <p>If <code>graph.them</code> is <code>NULL</code>, then <code>local_scan</code> computes the ‘us’ variant of the scan statistics. Otherwise, <code>graph.them</code> should be an igraph object and the ‘them’ variant is computed using <code>graph.us</code> to extract the neighborhood information, and applying <code>FUN</code> on these neighborhoods in <code>graph.them</code>. </p> <h3>Value</h3> <p>For <code>local_scan</code> typically a numeric vector containing the computed local statistics for each vertex. In general a list or vector of objects, as returned by <code>FUN</code>. </p> <h3>References</h3> <p>Priebe, C. E., Conroy, J. M., Marchette, D. J., Park, Y. (2005). Scan Statistics on Enron Graphs. <em>Computational and Mathematical Organization Theory</em>. </p> <h3>See Also</h3> <p>Other scan statistics: <code><a href="scan_stat.html">scan_stat</a>()</code> </p> <h3>Examples</h3> <pre> pair <- sample_correlated_gnp_pair(n = 10^3, corr = 0.8, p = 0.1) local_0_us <- local_scan(graph.us = pair$graph1, k = 0) local_1_us <- local_scan(graph.us = pair$graph1, k = 1) local_0_them <- local_scan(graph.us = pair$graph1, graph.them = pair$graph2, k = 0) local_1_them <- local_scan(graph.us = pair$graph1, graph.them = pair$graph2, k = 1) Neigh_1 <- neighborhood(pair$graph1, order = 1) local_1_them_nhood <- local_scan(graph.us = pair$graph1, graph.them = pair$graph2, neighborhoods = Neigh_1) </pre> <hr /><div style="text-align: center;">[Package <em>igraph</em> version 1.3.5 <a href="00Index.html">Index</a>]</div> </body></html>