Seq {Streamer}R Documentation

Producer class to generate (numeric) sequences

Description

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

Usage

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 mtmorgan@fhcrc.org

See Also

Stream

Examples

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

[Package Streamer version 1.38.0 Index]