recycle: Create a recycling iterator

Description Usage Arguments Examples

View source: R/recycle.R

Description

Create an iterator that recycles a specified iterable.

Usage

1
recycle(iterable, times=NA_integer_)

Arguments

iterable

The iterable to recycle.

times

integer. Number of times to recycle the values in the iterator. Default value of NA_integer_ means to recycle forever.

Examples

1
2
# Recycle over 'a', 'b', and 'c' three times
recycle(letters[1:3], 3)

itertools documentation built on May 21, 2017, 3:52 a.m.

Search within the itertools package
Search all R packages, documentation and source code

Questions? Problems? Suggestions? Tweet to @rdrrHQ or email at ian@mutexlabs.com.

Please suggest features or report bugs in the GitHub issue tracker.

All documentation is copyright its authors; we didn't write any of that.