I have a file similar to this but with more columns, but this is the logic:
23-07 23-08 23-09 23-10 23-11 ID Sire trait1 trait2
150 1 John 10 5
200 2 James 15 2
300 3 Josh 60 1
500 4 Peter 80 0
600 5 Peter 90 8
And I would like this:
Date Weight ID Sire trait1 trait2
23-07 150 1 John 10 5
23-09 200 2 James 15 2
23-08 300 3 Josh 60 1
23-10 500 4 Peter 80 0
23-10 600 5 Peter 90 8
I tried several approaches involving spread
and tidyr
, but I could not to do this.