I want to generate a sequence just like :
c(rep(1,7),rep(2,7),rep(3,7),rep(4,7),rep(5,7),rep(6,7),rep(7,7))
But for large number instead of 7, say 100.
How can I do it without repeating until 100?
Thanks
Use the each=
argument to rep
:
rep(1:7, each=7)