This is the current data frame structure
value. blue red
1 -1.22049503 -0.62733486
2 1.61641224 0.43102051
3 0.09079087 0.61619844
4 0.32325956 -0.17718356
want to change it to
value. number color
1 -1.22049503 blue
1 -0.62733486 red
2 1.61641224 blue
2 0.43102051 red
3 0.09079087 blue
3 0.61619844 red
4 0.32325956 blue
4 -0.17718356 red
I saw this question which does the other way. Transform structure of data frame in R