Hi, Im new to R. I have a problem in aggregating data
This is bugging me from 2days.
I have data like
Account.ID asset_name
6yS A
6yS B
6yS B
6yS C
6yU D
876 C
From here I want to make more columns of like dummies. But I want only one row each ID.
My output should look like this
Account.ID Flag_A Flag_B Flag_C Flag_D
6yS 1 2 1 0
6yU 0 0 0 1
876 0 0 1 0
I tried aggregating but they make it into another table, which I do not want to merge again, because I will be losing information.
Please help me out. Thank y'll in advance.