How can I turn partial columns to row and maintain the rest of the columns?
I have a sample table like below :
Name Date Math Science Computer
Zed 201401 89 90 93
Ben 201401 98 92 89
Dan 201401 83 96 92
Desired output:
Name Date Subject Grade
Zed 201401 Math 89
Zed 201401 Science 90
Zed 201401 Computer 93
Ben 201401 Math 98
Ben 201401 Science 92
Ben 201401 Computer 89
Dan 201401 Math 83
Dan 201401 Science 96
Dan 201401 Computer 92
I tried using t(dataFrame)
but it will transpose the whole data set.
Can anyone help? Thank you.