i_concat {iterors}R Documentation

Iteror that chains multiple arguments together into a single iterator

Description

i_concat(obj) takes an iterable that returns iterables, and chains together all inner values of iterables into one iterator. Analogous to unlist(recursive=FALSE).

i_chain for iterators is analogous to c() on vectors. i_chain constructs an iteror that returns elements from the first argument until it is exhausted, then elements from the next argument, and so on until all arguments have been exhausted.

Usage

i_concat(obj, ...)

i_chain(...)

Arguments

obj

an iterable.

...

multiple iterable arguments

Value

iteror that iterates through each argument in sequence

Author(s)

Peter Meilstrup

Examples

it <- i_chain(1:3, 4:5, 6)
as.list(it)

it2 <- i_chain(1:3, levels(iris$Species))
as.list(it2)

[Package iterors version 1.0 Index]