For the latter, R provides a special type of object called
<code class="sourceCode r">factor</code>. The following object simulates
such a categorical variable, for instance political orientation:</p>
<div class="sourceCode" id="cb13"><pre class="downlit sourceCode r">
<code class="sourceCode R"><span><span class="va">x4</span> <span class="op">&lt;-</span> <span class="fu"><a href="../reference/declared.html">declared</a></span><span class="op">(</span></span>
<span>  x <span class="op">=</span> <span clas