seq_along(vec)
is equivalent to 1:length(v)
. seq_along(4:10) # [1] 1 2 3 4 5 6 7 seq_along(4) # [1] 1 # Compare to seq() -- s.a. http://stackoverflow.com/questions/13732062/seq-vs-seq-along-when-will-using-seq-cause-unintended-results seq(4:10) # [1] 1 2 3 4 5 6 7 seq(4) # [1] 1 2 3 4
seq_along
was created in R 2.9.2 for performance reasons.