Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

irnorm

Random Number Iterators


Description

These function returns an iterators that return random numbers of various distributions. Each one is a wrapper around a standard R function.

Usage

irnorm(..., count)
irunif(..., count)
irbinom(..., count)
irnbinom(..., count)
irpois(..., count)

Arguments

count

number of times that the iterator will fire. If not specified, it will fire values forever.

...

arguments to pass to the underlying rnorm function.

Value

An iterator that is a wrapper around the corresponding random number generator function.

Examples

# create an iterator that returns three random numbers
  it <- irnorm(1, count=3)
  nextElem(it)
  nextElem(it)
  nextElem(it)
  try(nextElem(it))  # expect a StopIteration exception

iterators

Provides Iterator Construct

v1.0.13
Apache License (== 2.0)
Authors
Michelle Wallig [cre], Revolution Analytics [aut, cph], Steve Weston [aut]
Initial release

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.