I have a data frame
Name     Address    War   
Stacy_A  Stacy_A_1  A  
Stacy_B  Stacy_B_1  B  
Stacy_C  Stacy_C_1  C  
Stacy_A  Stacy_A_2  A  
Stacy_B  Stacy_B_2  B  
Stacy_C  Stacy_C_2  C  
Stacy_D  Stacy_D_2  O
so I have four unique names and under each name I have.
Stacy_Ahas 2 addresses and both in WarAStacy_Bhas 2 addresses and both in WarBStacy_Chas 2 addresses and both in WarcStacy_Dhas only 1 address and in WarO
What I want is the output in the format having just count.
I need to have a format where I can get
names    A  B  C   O    
Stacy_A  2  0  0   0    
Stacy_B  0  2  0   0  
Stacy_C  0  0  2   0  
Stacy_D  0  0  0   1