Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

icount

Counting Iterators


Description

Returns an iterator that counts starting from one.

Usage

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

# 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

Provides Iterator Construct

v1.0.13
Apache License (== 2.0)
Authors
Michelle Wallig [cre], Revolution Analytics [aut, cph], Steve Weston [aut]
Initial release

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.