Given such a data frame:
V1 V2
x 3
y 2
z 4
...
I'd like to transform it to:
V1
x
x
x
y
y
z
z
z
z
Each element in V1
has repeated for n
times and n
is the corresponding value in V2
. Do you know how to implement it quickly without for loop
? Thanks in advance!