)</code> at least in the beginning. The way that <code>lapply()</code> works, and the reason it is often a good alternative to for loops, is that it will go through each element in a list and perform a task (i.e. run a function). It has the added benefit that it will output the results as a list - something you’d have to otherwise code yourself into a loop.</p>
<p>An <code>lapply()</code> has the following structure:</p>
<div class="sourceCode" id="cb407"><pre class="sourceCode r"><code class="sourceCode