EVOLUTION-MANAGER
Edit File: sample_seq.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: Sampling a random integer sequence</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_seq {igraph}"><tr><td>sample_seq {igraph}</td><td style="text-align: right;">R Documentation</td></tr></table> <h2>Sampling a random integer sequence</h2> <h3>Description</h3> <p>This function provides a very efficient way to pull an integer random sample sequence from an integer interval. </p> <h3>Usage</h3> <pre> sample_seq(low, high, length) </pre> <h3>Arguments</h3> <table summary="R argblock"> <tr valign="top"><td><code>low</code></td> <td> <p>The lower limit of the interval (inclusive).</p> </td></tr> <tr valign="top"><td><code>high</code></td> <td> <p>The higher limit of the interval (inclusive).</p> </td></tr> <tr valign="top"><td><code>length</code></td> <td> <p>The length of the sample.</p> </td></tr> </table> <h3>Details</h3> <p>The algorithm runs in <code>O(length)</code> expected time, even if <code>high-low</code> is big. It is much faster (but of course less general) than the builtin <code>sample</code> function of R. </p> <h3>Value</h3> <p>An increasing numeric vector containing integers, the sample. </p> <h3>Author(s)</h3> <p>Gabor Csardi <a href="mailto:csardi.gabor@gmail.com">csardi.gabor@gmail.com</a> </p> <h3>References</h3> <p>Jeffrey Scott Vitter: An Efficient Algorithm for Sequential Random Sampling, <em>ACM Transactions on Mathematical Software</em>, 13/1, 58–67. </p> <h3>Examples</h3> <pre> rs <- sample_seq(1, 100000000, 10) rs </pre> <hr /><div style="text-align: center;">[Package <em>igraph</em> version 1.3.5 <a href="00Index.html">Index</a>]</div> </body></html>