makeIwrapper: Make Iterator for Random Numbers

Description Usage Arguments Value Examples

View source: R/iterators.R

Description

A funtion to make further iterators

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
makeIwrapper(FUN)

irunif(..., count)

irnorm(..., count)

irbinom(..., count)

irnbinom(..., count)

irpois(..., count)

isample(..., count)

irexp(..., count)

Arguments

FUN

A character string nominating an R function to generate the random numbers

...

extra arguments to be passed on to the generator function

count

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

Value

An iterator function

Examples

1
2
3
irexp <- makeIwrapper("rexp")
rexp_it <- irexp(n = 25)
rexp_it$nextElem()

BillVenables/WWRCourse documentation built on Jan. 31, 2021, 4:22 p.m.