ID Period Grade
1 P1 2
1 P2 3
1 P3 3
1 P4 2
Output Required
Id P1 P2 P3 P4
1 2 3 3 2
I'm trying this in R, basically we need to show grade in each period for the client 1,2 and so on.