I have this data set, I put a screenshot of real data instead of a code or something. sorry for messing up, I am a newbie here in R enter image description here
Then, I want to change the data into dummy set for "13 Source" categorical data, but it has to be summarized by "HH No". Which will look like this enter image description here I've tried to use to.dummy by varhandle, model.matrix but ended up messy dataset. Could anybody help me how to deal with this? Thanks a million in advance