2</span><span class="op">)</span></span>
<span class="r-in"><span class="va">sim_dat</span><span class="op">$</span><span class="va">group</span> <span class="op">&lt;-</span> <span class="fu"><a href="https://rdrr.io/r/base/factor.html" class="external-link">as.factor</a></span><span class="op">(</span><span class="va">sim_dat</span><span class="op">$</span><span class="va">group</span><span class="op">)</span></span>
<span class="r-in"></span>
<span class="r-in"><span class="co"># introduce random missing