seq - Creating a repeating vector sequence in R -
this question has answer here:
i need help. how create following vector sequence:
1 1 1 1 2 2 2 3 3 4
i tried use (rep) , (seq) still unsucessfull.
try this:
rep(1:4,4:1)
output:
[1] 1 1 1 1 2 2 2 3 3 4
Comments
Post a Comment