EVOLUTION-MANAGER
Edit File: makeIwrapper.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: Iterator Maker Generator</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 makeIwrapper {iterators}"><tr><td>makeIwrapper {iterators}</td><td style="text-align: right;">R Documentation</td></tr></table> <h2>Iterator Maker Generator</h2> <h3>Description</h3> <p>The <code>makeIwrapper</code> function makes iterator makers. The resulting iterator makers all take an optional <code>count</code> argument which specifies the number of times the resulting iterator should fire. The iterators are wrappers around functions that return different values each time they are called. The <code>isample</code> function is an example of one such iterator maker (as are <code>irnorm</code>, <code>irunif</code>, etc.). </p> <h3>Usage</h3> <pre> makeIwrapper(FUN) isample(..., count) </pre> <h3>Arguments</h3> <table summary="R argblock"> <tr valign="top"><td><code>FUN</code></td> <td> <p>a character string naming a function that generates different values each time it is called; typically one of the standard random number generator functions.</p> </td></tr> <tr valign="top"><td><code>count</code></td> <td> <p>number of times that the iterator will fire. If not specified, it will fire values forever.</p> </td></tr> <tr valign="top"><td><code>...</code></td> <td> <p>arguments to pass to the underlying <code>FUN</code> function.</p> </td></tr> </table> <h3>Value</h3> <p>An iterator that is a wrapper around the corresponding function. </p> <h3>Examples</h3> <pre> # create an iterator maker for the sample function mysample <- makeIwrapper('sample') # use this iterator maker to generate an iterator # that will generate three five member samples from the # sequence 1:100 it <- mysample(1:100, 5, count=3) nextElem(it) nextElem(it) nextElem(it) try(nextElem(it)) # expect a StopIteration exception </pre> <hr /><div style="text-align: center;">[Package <em>iterators</em> version 1.0.14 <a href="00Index.html">Index</a>]</div> </body></html>