I have a series of dataset with repeating scores, the data frame is as follows
ID,Variable,Category
1,6,A
2,4,C
3,3,D
4,4,C
5,5,B
6,3,D
7,6,A
8,4,C
9,5,B
10,3,D
I want it to create a logic like this
ID,A,B,C,D 1,1,0,0,0 2,0,0,1,0 3,0,0,0,1 4,0,0,1,0 5,0,1,0,0 6,0,0,0,1 7,1,0,0,0 8,0,0,1,0 9,0,1,0,0 10,0,0,0,1