hasNext {itertools}R Documentation

Does This Iterator Have A Next Element

Description

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

Usage

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

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

[Package itertools version 0.1-3 Index]