)</code>, <code>tapply()</code>, <code>sapply()</code>, <code>vapply()</code>, and <code>mapply()</code>. The apply functions can often do the tasks of most “home-brewed” loops, sometimes faster (though that won’t really be an issue for most people) but more importantly with a much lower risk of error. A strategy to have in the back of your mind which may be useful is; for every loop you make, try to remake it using an apply function (often <code>lapply</code> or <code>sapply</code> will work). If you