as_iterator {reticulate} | R Documentation |
Traverse a Python iterator or generator
Description
Traverse a Python iterator or generator
Usage
as_iterator(x)
iterate(it, f = base::identity, simplify = TRUE)
iter_next(it, completed = NULL)
Arguments
x |
Python iterator or iterable |
it |
Python iterator or generator |
f |
Function to apply to each item. By default applies the
|
simplify |
Should the result be simplified to a vector if possible? |
completed |
Sentinel value to return from |
Details
Simplification is only attempted all elements are length 1 vectors of type "character", "complex", "double", "integer", or "logical".
Value
For iterate()
, A list or vector containing the results of calling
f
on each item in x
(invisibly); For iter_next()
, the next
value in the iteration (or the sentinel completed
value if the iteration
is complete).
[Package reticulate version 1.38.0 Index]