iunique_justseen: Iterator that extracts the just-seen unique elements from an...

Description Usage Arguments Value Examples

View source: R/iunique.r

Description

Constructs an iterator that extracts each unique element in turn from an iterable object. Order of the elements is maintained. Only the element just seen is remembered for determining uniqueness.

Usage

1

Arguments

object

an iterable object

Value

an iterator that returns the just-seen unique elements from object

Examples

1
2
3
4
5
6
7
it <- ichain(rep(1,4), rep(2, 5), 4:7, 2)
it_iunique <- iunique_justseen(it)
as.list(it_iunique) # 1 2 4 5 6 7 2

it2 <- iterators::iter(c('a', 'a', "A", 'a', 'a', "V"))
it2_iunique <- iunique_justseen(it2)
as.list(it2_iunique) # a A a V

itertools2 documentation built on May 30, 2017, 7:17 a.m.