ether it is working.</strong></p>
<p>We fill out the missing line of <code>refCat()</code> where we choose the first level of the variable (assuming that <code>v</code> is a factor):</p>
<pre class="r"><code>refCat &lt;- function(v, ...) {
  val &lt;- levels(v)[1]
  res &lt;- val
  summaryResult(list(feature = &quot;Reference category&quot;, result = res,
                     value = val))
}</code></pre>
<p>And we use it on <code>pill</code> from <code>toyData</code>:</p>
<pre class="r"><code>refCat(toyData