pan>
</div><div class='output co'>#&gt;   a b untouched
#&gt; 1 A C         1
#&gt; 2 B D         2</div><div class='input'>
<span class='fu'>add_missing_combinations</span><span class='op'>(</span><span class='va'>df</span>, <span class='va'>a</span>, <span class='va'>b</span><span class='op'>)</span>
</div><div class='output co'>#&gt;    a b untouched
#&gt; 1  A C         1
#&gt; 2  B D         2
#&gt; 3  A A        NA
#&gt; 4  B A        NA
#&gt; 5  C A        NA
#&gt; 6  D A        NA
#&gt; 7  A B      