I have a dataset as below:
SUBD | X1 | X2
0    |.789|.655
1    |.889|.998
I was trying to convert the above dataset in the below format:
SUBD  | WK  | Per
0     | X1  | .789
0     | X2  | .655
1     | X1  | .889
1     | X2  | .998
I have tried reshape, melt, cast, t, gather function available in R but not able to get the desired output? Can anyone help me to achieve this?
 
     
     
    