powered by
nvec
seq_len(nvec[i])
sequence(nvec)
sequence
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.
sequence <- function(nvec) unlist(lapply(nvec, seq_len))
gl
seq
rep
sequence(c(3, 2)) # the concatenated sequences 1:3 and 1:2. #> [1] 1 2 3 1 2
Run the code above in your browser using DataLab