High Performance Loops in R


To For Loop or not to For Loop? Learn different ways to make use of for loops as well as when it might be more efficient to use other methods in favour of looping. We will also learn how to use the Microbenchmark package to time how long it takes to execute code when deciding to use one method over another to maximize efficiency.

Topics Covered:

##What You Will Need:

Once you have these set up, make sure to install the following packages (gapminder, dplyr, & microbenchmark) either through Tools > Install Packages in RStudio, or in the console:

install.packages('gapminder')
install.packages('dplyr')
install.packages('microbenchmark')

Here is the lesson material with the R output