File: icount.Rd

package info (click to toggle)
r-cran-iterators 1.0.7-1
  • links: PTS
  • area: main
  • in suites: jessie, jessie-kfreebsd
  • size: 532 kB
  • sloc: sh: 29; makefile: 1
file content (28 lines) | stat: -rw-r--r-- 561 bytes parent folder | download | duplicates (6)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
\name{icount}
\alias{icount}
\alias{icountn}
\title{Counting Iterators}
\description{
  Returns an iterator that counts starting from one.
}
\usage{
icount(count)
icountn(vn)
}
\arguments{
  \item{count}{number of times that the iterator will fire.
  If not specified, it will count forever.}
  \item{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
}
\keyword{utilities}