Skip to content
Prev 351152 / 398502 Next

elegant way to create a sequence with the 'rep' bulit-in function

Elegance is in the eye of the beholder.

But I would have thought that anything you do would be some variation of:

c(rep(1:3,e=2,time=4),
rep(4:5,e=4,time=3),
rep(6:9,e=3,time=2) )

## yielding

 [1] 1 1 2 2 3 3 1 1 2 2 3 3 1 1 2 2 3 3 1 1 2 2 3 3 4 4 4 4 5 5 5 5 4
4 4 4 5 5 5 5 4
[42] 4 4 4 5 5 5 5 6 6 6 7 7 7 8 8 8 9 9 9 6 6 6 7 7 7 8 8 8 9 9 9

Cheers,
Bert

Bert Gunter
Genentech Nonclinical Biostatistics
(650) 467-7374

"Data is not information. Information is not knowledge. And knowledge
is certainly not wisdom."
Clifford Stoll




On Sat, May 23, 2015 at 7:55 AM, Kathryn Lord
<kathryn.lord2000 at gmail.com> wrote: