hasNext: Does This Iterator Have A Next Element

Description Usage Arguments Value Examples

Description

hasNext is a generic function that indicates if the iterator has another element.

Usage

1
2
3
4
hasNext(obj, ...)

## S3 method for class 'ihasNext'
hasNext(obj, ...)

Arguments

obj

an iterator object.

...

additional arguments that are ignored.

Value

Logical value indicating whether the iterator has a next element.

Examples

1
2
3
  it <- ihasNext(iter(c('a', 'b', 'c')))
  while (hasNext(it))
    print(nextElem(it))


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

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

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

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