I have a dataframe with 2 columns
>mydata <- data.frame(Obj = c(1,2,3,2), Count = c(2,3,1,4))
>mydata
Obj Count
1 1 2
2 2 3
3 3 1
4 2 4
I want to split the Obj column based on count to get the atomic objects like (1, 1, 2, 2, 2, 3, 2, 2, 2, 2) Yeah that is reverse of the table function. Is there any function for doing this in R?
P.S: A simple for loop can do the trick, but I feel it is always good to use inbuilt efficient functions.