I need some help. How to create the following vector sequence:
1 1 1 1 2 2 2 3 3 4
I tried to use (rep) and (seq) but still unsucessfull.
I need some help. How to create the following vector sequence:
1 1 1 1 2 2 2 3 3 4
I tried to use (rep) and (seq) but still unsucessfull.
Try this:
Output:
or less concisely:
c(rep(1, 4), rep(2,3), rep(3, 2), 4)
output:
[1] 1 1 1 1 2 2 2 3 3 4