The R function rep() replicates each element of a vector:
> rep(c(\"A\",\"B\"), times=2)
[1] \"A\" \"B\" \"A\" \"B\"
This is like the list m
What do you think about this way?
To repeat a value:
>>> repetitions=[]
>>> torep=3
>>> nrep=5
>>> for i in range(nrep):
>>> i=torep
>>> repetitions.append(i)
[3, 3, 3, 3, 3]
To repeat a sequence:
>>> repetitions=[]
>>> torep=[1,2,3,4]
>>> nrep= 2
>>> for i in range(nrep):
>>> repetitions=repetitions+torep
>>> print(repetitions)
[1, 2, 3, 4, 1, 2, 3, 4]