I would like to create a sequence from two numbers, such that the occurrence of one of the numbers decreases (from n_1
to 1) while for the other number the occurrences are fixed at n_2
.
I've been looking around for and tried using seq and rep to do it but I can't seem to figure it out.
Here is an example for c(0,1)
and n_1=5
, n_2=3
:
0,0,0,0,0,1,1,1,0,0,0,0,1,1,1,0,0,0,1,1,1,0,0,1,1,1,0,1,1,1
And here for c(0,1)
and n_1=2
, n_2=1
:
0,0,1,0,1
times = rbind(n_1:1, n_2)
withoutc()
should suffice – Griego