the dataset like this:
a1 b1 1
a1 b1 0
a1 b2 0
a2 b3 1
a2 b3 0
a2 b4 0
if a1&b1 as a pair, have the dummy of 1 and 0, I just want to delete the dummy of 0 of the pair of a1&b1 and keep dummy of 1. And for a1&b2, only dummy of 0 is there, so keeping dummy 0 of the pair of a1&b2
i am a R programming beginner, cant deal with this problem easily.
output should be:
a1 b1 1
a1 b2 0
a2 b3 1
a2 b4 0
New contributor
Pang kalok is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.