ilimit {itertools}R Documentation

Create a limited iterator

Description

Create an iterator that wraps a specified iterable a limited number of times.

Usage

ilimit(iterable, n)

Arguments

iterable

Iterable to iterate over.

n

Maximum number of values to return.

Examples

# Limit icount to only return three values
as.list(ilimit(icount(), 3))

[Package itertools version 0.1-3 Index]