ness in x1 as example</span></span>
<span class="r-in"><span class="co"># NOTE: This is only done as an example, in reality you would</span></span>
<span class="r-in"><span class="co">#       already have missing data, not introduce it yourself.</span></span>
<span class="r-in"><span class="va">sim_dat</span><span class="op">$</span><span class="va">x1</span> <span class="op">&lt;-</span> <span class="fu"><a href="https://rdrr.io/r/base/ifelse.html" class="external-link">ifelse</a></span><span class="op">(<