Description Usage Arguments Value Examples
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.
1 | iunique_justseen(object)
|
object |
an iterable object |
an iterator that returns the just-seen unique elements from
object
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
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.