ilength: Consumes an iterator and computes its length

Description Usage Arguments Value Examples

Description

Counts the number of elements in an iterator. NOTE: The iterator is consumed in the process.

Usage

1
ilength(object)

Arguments

object

an iterable object

Value

the number of elements in the iterator

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
ilength(1:5) == length(1:5)

it <- iterators::iter(1:5)
ilength(it) == length(1:5)

it2 <- ichain(1:3, 4:5, 6)
ilength(it2)

it3 <- ichain(1:3, levels(iris$Species))
ilength(it3)

itertools2 documentation built on May 2, 2019, 3:37 p.m.