How can I repeat the integers 1:20 in a vector 20 times each?
i want something like
s <- 1,1,1,2,2,2,3,3,3 etc.....
(except 20 1's then 20 2's then 20 3's.... you get the idea)
I am trying this
l <- 1:20
S <- for(i in l) rep(i, 20)
an one liner would be awesome, something like this
S <- for (i in 1:20, rep(i, 20))
but I am struggling.
thanks,
Jesse