I'm a rookie trying to figure out the best way to do a long-wide conversion using tidyr.
My data looks like this:
ID Case Case_date
1 A 1-Sep
1 B 2-Sep
1 C 3-Sep
2 D 4-Sep
3 E 5-Sep
3 F 6-Sep
I want it to look like this:
ID Case_1 Case_1_date Case_2 Case_2_date Case_3 Case_3_date
1 A 1-Sep B 2-Sep C 3-Sep
2 D 4-Sep NULL NULL NULL NULL
3 E 5-Sep F 6-Sep NULL NULL
Any help is appreciated! I think pivot_wider is part of the solution for me here but I'm not quite getting it.