tags:

views:

53

answers:

1

I am trying to take an existing vector and repeat each element of it six times. I feel like this should be easy using rep() but I keep hitting the wall. Basically I would like to take this vector:

1027 1028 1030 1032 1037

And turn it into this:

1027 1027 1027 1027 1027 1027 1028 1028 1028 1028 1028 1028 ...
+3  A: 

Use each argument:

rep(c(1027,1028,1030,1032,1037),each=6)
mbq