There is 2 column in the data frame categorical variable:
ID
Var1
1
A1
1
A2
1
A3
2
A1
2
A2
3
A1
3
A2
3
A3
3
A2
I would like to code if ID contained all A1+A2+A3 then code into one A unit, that means according to the table above ID (1) & (3) contain A but ID (2) does not have A. I would like to make a new table with results.