 categorical variable displays the valid
values first, and the missing values last.</p>
<p>If the original order is important, the argument <code>drop_na</code>
can be deactivated:</p>
<div class="sourceCode" id="cb17"><pre class="downlit sourceCode r">
<code class="sourceCode R"><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">x4</span>, drop_na <span class="op">=</span> <span class="cn">FALSE</span><span