Description Usage Arguments Details See Also Examples
For each element of nvec
the sequence seq_len(nvec[i])
is created. These are concatenated and the result returned.
1 | sequence(nvec)
|
nvec |
a non-negative integer vector each element of which specifies the end point of a sequence. |
Earlier versions of sequence
used to work for 0 or negative inputs as
seq(x) == 1:x
.
Note that sequence <- function(nvec) unlist(lapply(nvec, seq_len))
and it mainly exists in reverence to the very early history of R.
1 2 |
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.