vecseq returns concatenated multiple sequences
vecseq(x, y = NULL, concat = TRUE, eval = TRUE)vector of sequence start points
vector of sequence end points (if is.null(y) then x
are taken as endpoints, all starting at 1)
vector of sequence end points (if is.null(y) then
x are taken as endpoints, all starting at 1)
vector of sequence end points (if is.null(y) then
x are taken as endpoints, all starting at 1)
if concat == FALSE and eval == FALSE a list with n calls that generate sequences
if concat == FALSE and eval == TRUE a list with n sequences
if concat == TRUE and eval == FALSE a single call generating the concatenated
sequences
if concat == TRUE and eval == TRUE an integer vector of concatentated sequences
This is a generalization of sequence() in that you can choose
sequence starts other than 1 and also have options to no concat and/or
return a call instead of the evaluated sequence.
:, seq(), sequence()
sequence(c(3, 4))
#> [1] 1 2 3 1 2 3 4
vecseq(c(3, 4))
#> [1] 1 2 3 1 2 3 4
vecseq(c(1, 11), c(5, 15))
#> [1] 1 2 3 4 5 11 12 13 14 15
vecseq(c(1, 11), c(5, 15), concat=FALSE, eval=FALSE)
#> [[1]]
#> 1:5
#>
#> [[2]]
#> 11:15
#>
vecseq(c(1, 11), c(5, 15), concat=FALSE, eval=TRUE)
#> [[1]]
#> [1] 1 2 3 4 5
#>
#> [[2]]
#> [1] 11 12 13 14 15
#>
vecseq(c(1, 11), c(5, 15), concat=TRUE, eval=FALSE)
#> c(1:5, 11:15)
vecseq(c(1, 11), c(5, 15), concat=TRUE, eval=TRUE)
#> [1] 1 2 3 4 5 11 12 13 14 15