I want to repeat an observation in a dataset based on the value in a field. I know this is usually the opposite of what most do. Let me explain: I am running a small contest and have the number of "tickets" each participant has. Therefore once I explode the dataset, I can assign a random number to each observation and select a winner.
My Data looks like this:
name tickets
aaa 1
bbb 2
ccc 1
ddd 3
What I want in the end is:
name tickets
aaa 1
bbb 2
bbb 2
ccc 1
ddd 3
ddd 3
ddd 3
Any ideas ?