---
title: "Index of `iteror` functions by task"
output:
  html_vignette:
    self_contained: true
vignette: >
  %\VignetteEngine{knitr::rmarkdown}
  %\VignetteIndexEntry{Index of `iteror` functions by task}
  %\VignetteEncoding{UTF-8}
---

## Basic methods

* [`is.iteror`](../reference/is.iteror.html) -- Check whether a function has class 'iteror'.
* [`iteror`](../reference/iteror.html) -- Generic function to convert a given  object into an iteror.
* [`nextOr`](../reference/nextOr.html) -- Obtain the next element from an iteror.
* [`r_to_py.iteror`](../reference/r_to_py.iteror.html) -- Make an iteror act as a Python iterator (requires package `reticulate`)

## Consuming / summarizing an iteror

Most of these functions are S3 generic.

* [`as.character`](../reference/as.vector.iteror.html), [`as.numeric`](../reference/as.vector.iteror.html), [`as.logical`](../reference/as.vector.iteror.html), [`as.list`](../reference/as.vector.iteror.html) -- Collect all an iteror's values into a vector.
* [`as.vector`](../reference/as.vector.iteror.html) -- Collect values into a specified type of vector.
* [`concat`](../reference/concat.html) -- Paste an iteror's values end-to-end in one vector.
* [`consume`](../reference/consume.html) -- Take all or some of an iteror's elements and discard them.
* [`count`](../reference/count.html) -- Compute all elements, discard them and return their count.
* [`dotproduct`](../reference/dotproduct.html) -- Sum of products of corresponding elements of two iterors.
* [`nth`](../reference/nth.html) -- Compute and discard the first $n-1$ elements and return the $n$th.
* [`prod.iteror`](../reference/reduce.html) -- Product of all an iteror's values (i.e. [`reduce`](../reference/reduce.html) using `*`.)
* [`quantify`](../reference/quantify.html) -- Consume an iteror and return how many elements were TRUE.
* [`record`](../reference/record.html) -- Write an iteror's elements to a file.
* [`reduce`](../reference/reduce.html) -- Combine all of iteror's values in sequence using a 2-argument function, returning the final value.
* [`sum.iteror`](../reference/reduce.html) -- Sum all values of an iteror (i.e. [`reduce`](../reference/reduce.html) using `+`.)
* [`take`](../reference/take.html) -- Take some number of elements and return them in a vector.

## Iterate over given data

By convention, functions in this package that _construct_ an iterator in terms of basic data or other objects have names beginning with "`i`".

* [`ienum`](../reference/ienumerate.html), [`ienumerate`](../reference/ienumerate.html) -- return the elements of an iterable alongside its index.
*  [`i_enumerate`](../reference/ienumerate.html) -- return the elements of a vector or array alongside indices, optionally chunked or recycled.
* [`i_repeat`](../reference/i_repeat.html) -- Return one value over and over again.
* [`iteror.array`](../reference/iteror.html) -- Iterate over an array along given dimensions.
* [`iteror.data.frame`](../reference/iteror.html) -- Iterate over rows or columns of a data frame.
* [`iteror.default`](../reference/iteror.html) -- Iterate over a vector from first to last index.

## Counting or other mathematically defined processes

* [`i_combinations`](../reference/i_combinations.html) -- Enumerate all combinations of $m$ elements of a given vector, with or without replacement.
* [`i_count`](../reference/i_count.html) -- Produce an integer sequence starting with 1.
* [`i_countn`](../reference/i_count.html) -- Enumerate multiple indices, in either row-major or col-major order.
* [`i_div`](../reference/i_div.html) -- Return a sequence of $n$ integers that add up to a given total.
* [`i_grid`](../reference/i_grid.html) -- Produce a sequence over the Cartesian product of the given vectors.
* [`i_permutations`](../reference/i_permutations.html) -- A sequence containing all permutations of a given vector.
* [`i_seq`](../reference/i_seq.html) -- Generate arithmetic sequences with specific step size and origin.
* [`i_seq_along`](../reference/i_seq.html) -- Counting sequence parallel to a given vector.


## Random number generation

Random number iterators can be made reproducible by specifying `independent=TRUE` and specifying a seed value, though this has a performance cost.

* [`i_RNGStream`](../reference/i_RNGStream.html), [`i_RNGSubStream`](../reference/i_RNGStream.html) -- Create a sequence of seed values so as to make parallel, decorrelated random streams.
* [`i_rnbinom`](../reference/rng.html), [`irnorm`](../reference/rng.html), [`i_rpois`](../reference/rng.html), [`irunif`](../reference/rng.html), [`i_sample`](../reference/rng.html), [`irbinom`](../reference/rng.html) -- Draw samples from the given distribution.


## Iterators dealing with files or functions

* [`i_read.table`](../reference/i_read.table.html) -- Reads row-wise from delimited text files.
* [`i_readBin`](../reference/i_readBin.html) -- Read binary data from file connections.
* [`i_readLines`](../reference/i_readLines.html) -- Read lines from text connections.
* [`i_readdf`](../reference/i_readdf.html) -- Read rows from several files in parallel (one per column).
* [`i_replay`](../reference/record.html) -- reads back values from a data file created with [`record`](../reference/record.html)
* [`i_tabulate`](../reference/i_tabulate.html) -- Evaluate a function over an arithmetic sequence.
* [`record`](../reference/record.html) -- Write values from an iterator to a file.

## Custom iterators

* [`iteror.function`](../reference/iteror.function.html) -- Create an iteror with custom behavior.

## Higher order iterator functions

By convention, in this package, functions that transform iterators -- creating a new iterator based on one or more underlying iterables -- begin with "`i_`", with an underscore.

### Iterators as sequences -- Looping, repeating, indexing

* [`i_chunk`](../reference/i_chunk.html) -- Collect $n$ adjacent values from an iterable and return a list.
* [`i_pad`](../reference/i_pad.html) -- After a given iterator ends, return a padding value indefinitely.
* [`i_recycle`](../reference/i_recycle.html) -- Record the values emitted by the underlying iterator and replay them in a loop.
* [`i_rep`](../reference/i_rep.html) -- Repeat each element of an iterable a given number of times.
* [`i_slice`](../reference/i_slice.html) -- Return elements from an iterable based on a starting point and stride.
* [`i_window`](../reference/i_window.html) -- Return adjacent elements from the underlying iteror in a sliding window.

### Operating on data within iterators

* [`i_accum`](../reference/reduce.html) -- Apply a 2-argument function between an iteror's elements, and return a sequence of partial totals.
* [`i_apply`](../reference/i_apply.html) -- Apply a given function to each element.
* [`i_enumerate`](../reference/i_enumerate.html) -- Return an index along with each element.
* [`i_star`](../reference/i_starmap.html), [`i_starmap`](../reference/i_starmap.html), [`i_map`](../reference/i_map.html)  -- Apply a multiple-argument function to multiple parallel iterators.

### Selection, filtering, limiting

* [`i_break`](../reference/i_break.html) -- Return elements only while the given (no-argument) function evaluates to TRUE.
* [`i_dedup`](../reference/i_dedup.html) -- Discard elements that are identical the immediately preceding element.
* [`i_drop`](../reference/i_keep.html) -- Discard elements for which a criterion function returns TRUE.
* [`i_dropwhile`](../reference/i_dropwhile.html) -- Discard elements from an iterator until the criterion function evaluates FALSE.
* [`i_keep`](../reference/i_keep.html) -- Keep only elements for which an applied criterion function returns `TRUE`.
* [`i_keepwhile`](../reference/i_keepwhile.html) -- Keep elements only until an applied criterion returns `FALSE`.
* [`i_limit`](../reference/i_limit.html) -- Keep only the first $n$ elements from the given iteror.
* [`i_mask`](../reference/i_mask.html) -- Return elements for which a parallel iterator is TRUE.
* [`i_rle`](../reference/i_rle.html) -- Compress runs of identical adjacent elements, returning one value and a run length.
* [`i_rleinv`](../reference/i_rle.html) -- Inverse transform of [`i_rle`](../reference/i_rle.html).
* [`i_timeout`](../reference/i_timeout.html) -- Return elements only until the timeout is reached.
* [`i_unique`](../reference/i_unique.html) -- Pass along only unique elements of an iterator, using a hash table.

### Combining / splitting multiple iterators

* [`i_chain`](../reference/i_chain.html) -- String all values from each iterable argument together.
* [`i_concat`](../reference/i_chain.html) -- String an iterable of iterables together.
* [`i_roundrobin`](../reference/i_roundrobin.html) -- Return one element at a time from each of a series of iterors in rotation.
* [`i_tee`](../reference/i_tee.html) -- Split an iterator into multiple iterators yielding the same sequence. 
* [`i_zip`](../reference/i_zip.html) -- Combine corresponding elements of parallel iterators into a list.
* [`i_zip_longest`](../reference/i_zip.html) -- [`i_zip`](../reference/i_zip.html) but pad any iterators that end early.
