0

For example the dataset looks like this

ID|Occurence|Name  
 1        X  James
 1       XP  Harry  
 2        X  James
 2       XP  Harry
 2       RQ  William
 3       XP  Harry
 3       RQ  William
 3       PS  Diana
 3        X  James
 4       PS  Diana

New dataset should look like this. I believe i would group_by the ID and pivot_wider but not sure how to get the values as columns and add the corresponding "Name" values as inputs

ID|X    |XP     |RQ       |PS   |
 1 James Harry   
 2 James Harry   William   
 3 James Harry   William   Diana
 4                         Diana
user35131
  • 1,105
  • 6
  • 18

0 Answers0