I have a dataframe of transactional data, for example:
ID TYPE QUANTITY
01 A 2
01 B 1
01 C 4
02 A 3
02 C 2
03 C 3
I need to split ID by the factors in TYPE and from those factors create new columns that contain the QUANTITY value for each column.
So that it will look like this:
ID A B C
01 2 1 4
02 3 0 2
03 0 0 3