SyntaxFix
Write A Post
Hire A Developer
Questions
You missed the each= argument to rep():
each=
rep()
R> n <- 3 R> rep(1:5, each=n) [1] 1 1 1 2 2 2 3 3 3 4 4 4 5 5 5 R>
so your example can be done with a simple
R> rep(1:8, each=20)