For each element of nvec the sequence seq_len(nvec[i]) is created. These are concatenated and the result returned.
sequence(nvec)
| Parameter | Description |
|---|---|
nvec |
a non-negative integer vector each element of which specifies the end point of a sequence. |
# NOT RUN {
sequence(c(3, 2)) # the concatenated sequences 1:3 and 1:2.
#> [1] 1 2 3 1 2
# }