>
<code class="sourceCode R"><span></span>
<span><span class="co"># This is a reusable function to restrict ages</span></span>
<span><span class="va">age_restrict</span> <span class="op">=</span> <span class="kw">function</span><span class="op">(</span><span class="va">df</span>, <span class="va">age_col</span>, <span class="va">min_age</span> <span class="op">=</span> <span class="fl">18</span>, <span class="va">max_age</span> <span class="op">=</span> <span class="fl">65</span><span class="op">)</span> <s