nextElem {iterators} | R Documentation |
nextElem
is a generic function used to produce values. If a
checkFunc
was specified to the constructor, the potential
iterated values will be passed to the checkFunc
until the
checkFunc
returns TRUE
. When the iterator has no more
values, it calls stop with the message 'StopIteration'.
nextElem(obj, ...)
## S3 method for class 'containeriter'
nextElem(obj, ...)
## S3 method for class 'funiter'
nextElem(obj, ...)
obj |
an iterator object. |
... |
additional arguments that are ignored. |
The value.
it <- iter(c('a', 'b', 'c'))
print(nextElem(it))
print(nextElem(it))
print(nextElem(it))