icount: Counting Iterators

Description Usage Arguments Value Examples

View source: R/extra.R

Description

Returns an iterator that counts starting from one.

Usage

1
2
icount(count)
icountn(vn)

Arguments

count

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

vn

vector of counts.

Value

The counting iterator.

Examples

1
2
3
4
5
6
  # create an iterator that counts from 1 to 3.
  it <- icount(3)
  nextElem(it)
  nextElem(it)
  nextElem(it)
  try(nextElem(it))  # expect a StopIteration exception

iterators documentation built on May 19, 2017, 7:35 p.m.

Search within the iterators package
Search all R packages, documentation and source code

Questions? Problems? Suggestions? Tweet to @rdrrHQ or email at ian@mutexlabs.com.

Please suggest features or report bugs in the GitHub issue tracker.

All documentation is copyright its authors; we didn't write any of that.