I'm banging my head against the wall for this. It must be so easy, but in my 7+ years of R coding I never had to do this, and I can't figure out how to do it now.
Here's a toy df:
> x <- c(1,2,3)
> y <- c(2,3,4)
> TRY <- as.data.frame(x,y)
I want to see a brand new vector (in a df or just as a vector, whatever) that has the value "1" repeated 2 times, and then "2" repeated 3 times, and then "3" repeated 4 times.
That's all I want. Can someone PLEASE help me?
I thought of melt and cast and all that, but I don't think they're what I need here.
Thanks! Divya