Description Usage Arguments Value Examples
Constructs an iterator of an iterable object
that returns its elements
in pairs.
1 | ipairwise(object)
|
object |
an iterable object |
an iterator that returns pairwise elements
1 2 3 4 5 6 7 8 9 10 | it <- ipairwise(iterators::iter(letters[1:4]))
iterators::nextElem(it) # list("a", "b")
iterators::nextElem(it) # list("b", "c")
iterators::nextElem(it) # list("c", "d")
it2 <- ipairwise(1:5)
iterators::nextElem(it2) # list(1, 2)
iterators::nextElem(it2) # list(2, 3)
iterators::nextElem(it2) # list(3, 4)
iterators::nextElem(it2) # list(4, 5)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.