 r"><span id="cb407-1"><a href="loops.html#cb407-1" tabindex="-1"></a><span class="fu">lapply</span>(X, FUN)</span></code></pre></div>
<p>Here <code>X</code> is the vector which we want to do <em>something</em> to. <code>FUN</code> stands for how much fun this is (just kidding!). It’s also short for “function”.</p>
<p>Let’s start with a simple demonstration first. Let’s use the <code>lapply()</code> function create a sequence from 1 to 5 and add 1 to each observation (just like we did when we used