Dear all,
I have several datasets I would like to merge, however, they are set up differently.

What I have is:
HHID Appliance Cost Number
1 Phone 10 2
1 TV 150 1
1 Fridge 200 1
1 Radio 5 1
2 TV 140 1
2 Light 3 4
3 Charger 4 3
3 CD Player 5 1
3 Freezer 100 1
What I want is:
HHID Phone TV Fridge Radio Light Charger CD Player Freezer Phone_Cost
1 2 1 1 1 0 0 0 0 10
2 0 1 1 0 0 0 0 0 0
3 0 0 0 0 0 3 1 1 0
...and of course more variables with the TV_Cost, Fridge_Cost etc. pp.

HHID = household ID
Appliance = name of appliance
Costs = costs of respective appliance
Number = number pf appliance available in the household


Of course, my dataset is much larger which is why I would prefer some easy code.

Thank you in advance :-)

With kind regards

Maria