I have a quite large dataframe structured like this:
id x1 x2 x3 y1 y2 y3 z1 z2 z3 v
1 2 4 5 10 20 15 200 150 170 2.5
2 3 7 6 25 35 40 300 350 400 4.2
I need to create a dataframe like this:
id xsource xvalue yvalue zvalue v
1 x1 2 10 200 2.5
1 x2 4 20 150 2.5
1 x3 5 15 170 2.5
2 x1 3 25 300 4.2
2 x2 7 35 350 4.2
2 x3 6 40 400 4.2
I'm quite sure I have to do it with the reshape package, but I'm not able to get what I want.
Could you help me?
Thanks