What is the difference between seq(4) and seq_along(4)?

Category: R LanguageWhat is the difference between seq(4) and seq_along(4)?
Editor">Editor Staff asked 2 years ago

What is the difference between seq(4) and seq_along(4)?

1 Answers
Editor">Editor Staff answered 2 years ago

Seq(4) means vector from 1 to 4 (c(1,2,3,4)) whereas seq_along(4) means a vector of the length(4) or 1(c(1)).