Is there an R function to reshape this data from long to wide?
问题 How the data looks now: Coach ID | Student | score | --------------------------------- 1 | A | 8 | 1 | B | 3 | 2 | A | 5 | 2 | B | 4 | 2 | C | 7 | To look like this: Coach ID | Student | score | student_2|score_2| student_3|score_3 ------------------------------------------------------------------ 1 | A | 8 | B | 3 | 2 | A | 5 | B | 4 | C | 7 Is there anyway to reshape data from long to wide? Thanks! 回答1: You could create a new identifier column with unique value for every student and then