Is there a way to reshape wide to long in R based on the first part of column name? I have the following data:
id | Jan_shoulder | Jan_head | Jan_knee | Feb_shoulder | Feb_head | Feb_knee
1 | yes | no | yes | no | no | no
2 | no | no | no | yes | yes | no
And I want to convert it so that each row corresponds to a unique id and month, such as:
id | month | shoulder | head | knee
1 | Jan | yes | no | yes
1 | Feb | no | no | no
2 | Jan | no | no | no
2 | Feb | yes | yes | no