I have a dataframe like this : enter image description here
I would like to dupplicate each line the number of times indicated in the column "nombreIndividus".
I tried with rep()
and each =
and/or time =
but I can't do it.
Example :
incomeGlobalCopie <- incomeGlobalCopie[rep(1:nrow(incomeGlobalCopie),
each=incomeGlobalCopie$nombreIndividus)]
Can you help me ?
Thanks