Description Usage Arguments Details Value Examples
Constructs an iterator that returns an object over and over again.
1 |
object |
object to return indefinitely. |
times |
the number of times |
Runs indefinitely unless the times
argument is specified. Used as
argument to imap
for invariant function
parameters. Also used with izip
to create constant
fields in a tuple record.
iterator that returns object
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 | it <- irepeat(42)
iterators::nextElem(it)
iterators::nextElem(it)
iterators::nextElem(it)
# Further calls to iterators::nextElem(it) will repeat 42
it2 <- irepeat(42, times=4)
iterators::nextElem(it2)
iterators::nextElem(it2)
iterators::nextElem(it2)
iterators::nextElem(it2)
# The object can be a data.frame, matrix, etc
it3 <- irepeat(iris, times=4)
iterators::nextElem(it3)
iterators::nextElem(it3)
iterators::nextElem(it3)
iterators::nextElem(it3)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.