   2     1
## 5    NA     1     1     3</code></pre>
<ul>
<li>Using a function
<ul>
<li>function: input + computation + output</li>
<li>If you write a function, you gain efficiency because you don’t need to copy and paste the computation part.</li>
</ul></li>
</ul>
<div class="sourceCode" id="cb26"><pre class="sourceCode r"><code class="sourceCode r"><span id="cb26-1"><a href="Intro.html#cb26-1"></a><span class="co"># Create a custom function</span></span>
<span id="cb26-2"><a href="Intro.html#cb26-2"></a