Seq-class: Producer class to generate (numeric) sequences

Description Usage Arguments Constructors Methods Internal Class Fields and Methods Author(s) See Also Examples

Description

A Producer-class to generate a sequence (possibly long) of numbers.

Usage

1
2
Seq(from = 1L, to=.Machine$integer.max, by = 1L, yieldSize=1L,
    ...)

Arguments

from

A starting value of any type (e.g., integer, numeric supported by base::seq.

to

An ending value, typically of the same type as from.

by

A value, typically of the same class as from, indicating the increment between successive numbers in the sequence. by = 0 can create an infinite stream.

yieldSize

A integer(1) indicating the length of the output sequence each time yield() is invoked.

...

Additional arguments passed to Producer.

Constructors

Use Seq to construct instances of this class.

Methods

See Producer Methods.

Internal Class Fields and Methods

Internal fields of this class are are described with getRefClass("Seq")$fields.

Internal methods of this class are described with getRefClass("Seq")$methods() and getRefClass("Seq")$help().

Author(s)

Martin Morgan [email protected]

See Also

Stream

Examples

1
2
3
s <- Seq(1, 10, yieldSize=5)
while(length(y <- yield(s)))
    print(y)

Streamer documentation built on May 2, 2018, 3:13 a.m.