icount {itertools2}R Documentation

Iterator of neverending numeric sequence with initial value and step size

Description

Constructs an iterator that generates a neverending sequence of evenly spaced values starting with icount. The step size is given by step.

Usage

icount(start = 0, step = 1)

Arguments

start

sequence's initial value

step

sequence's step size

Details

NOTE: Use a negative step size to generate decreasing sequences.

Often used as an argument to imap to generate consecutive data points.

Value

sequence's iterator

Examples

it <- icount()
iterators::nextElem(it)
iterators::nextElem(it)
iterators::nextElem(it)

it2 <- icount(start=5.5, step=1.5)
iterators::nextElem(it2)
iterators::nextElem(it2)
iterators::nextElem(it2)

[Package itertools2 version 0.1.1 Index]