Changelog
Source:NEWS.md
iterors 1.0
Initial release.
- Split off from “async” package.
- Incorporated/ported “iterators” package.
- Incorporated/ported “itertools” package.
- Incorporated/ported “itertools2” package.
New functions:
-
i_enumerate.array
can iterate over arbitrary margins, providing you with a vector index. -
i_window
constructs a sliding window of arbitrary length over a given iterator, generalizingitertools2::ipairwise
anditripletwise
. - New functions
i_rle()
andi_rle_inverse()
for run-length encoding. - Introduced accumulation methods
i_accum()
,reduce()
, andsum()
andprod()
. -
i_chain(...)
has a companion functioni_concat(it)
which accepts an iterable (rather than...
). - New iteror methods for
as.numeric
,as.vector
,as.character
, andas.logical
. -
concat()
pastes chunks from an iterator into a vector.
New features:
- Memory-backed and counting iterors
icount
,icountn
,idiv
,igrid
,iseq
,i_enumerate.default
,iteror.default
,iteror.data.frame
,iteror.default
andi_enumerate.array
all have shared logic; all accept optionschunks
,chunksize
andrecycle
with equivalent behavior. -
icount
andicountn
preserve dimnames. - Multidimensional iterators
icountn
,igrid
,i_enumerate.array
anditeror.array
have optionrowMajor
to control the order of iteration. -
i_unique
uses a hash table rather than linear scan, for much improved performance; it also now works with any type of R object. - Random number iterators like
irunif
,isample
and friends accept optionsindependent
, andseed
if given, the iterator will maintain a private seed value, so that interleaving with other iterators does not affect reproducibility. You can use a specific random number generator algorithm by also givingkind
,normal.kind
, andsample.kind
. -
i_tee
works for any iterator, using a queue, where previouslyitertools::i_tee
only worked for memory-backed iterators. - Python compatibility:
py_iteror
wraps an iterator so that it can be used by Python code via packagereticulate
. Meanwhileiteror
has a method for Python objects, allowing Python iterators to be used transparently with iteror code.