concat | R Documentation |
concat
collects all values from an iterable object, and pastes
them end to end into one vector. In other words concat
is to
as.list.iteror
as c
is to list
.
concat(obj, mode = "list", n = Inf, ...)
## Default S3 method:
concat(obj, mode = "list", n = as.integer(2^31 - 1), ...)
## S3 method for class 'iteror'
concat(obj, mode = "list", n = Inf, length.out = Inf, ...)
obj |
An iteror. |
mode |
The mode of vector to return. |
n |
The maximum number of times to call |
... |
passed along to iteror constructor. |
length.out |
The target size of the output vector (after
results have been pasted together). If the iteror ends (or emits
|
a vector with mode mode
.
it <- i_apply(icount(), seq_len) # [1], [1, 2], [1, 2, 3], ...
concat(it, n=4, mode="numeric") # [1, 1, 2, 1, 2, 3, 1, 2, 3, 4]
concat(it, length.out=4, mode="numeric") # [1, 1, 2, 1, 2, 3, 1, 2, 3, 4]
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.