I am beginner in R and took several hours trying to solve an issue.
I would "disaccumulate" the value of a variable in a dataset, obtaining individual observations in rows. I think this is best explained with an example.
I would go from:
Variable 1 Variable 2 Count
GROUP1 A 3
GROUP1 B 2
GROUP2 A 2
GROUP2 B 4
to:
Variable 1 Variable 2 Count
GROUP1 A 1
GROUP1 A 1
GROUP1 A 1
GROUP1 B 1
GROUP1 B 1
GROUP2 A 1
GROUP2 A 1
GROUP2 B 1
GROUP2 B 1
GROUP2 B 1
GROUP2 B 1
I think maybe I can approach the solution using apply but I have tried using melt, apply with strsplit, xtabs ... but I did not get a result.
Thank you very much in advance, greetings.