Applying the DRY principle to repetitive R code (CC132)

July 29, 2021 • PD Schloss • 1 min read

Do you have R scripts where you repeat the same chunk of code over and over? You need to learn about the DRY principle! DRY stands for Don’t Repeat Yourself. Following this principle will make your code easier to manage and help you to avoid propogating errors across your project. Check out this episode to see how Pat uses the DRY principle to minimize duplication and then demonstrates how to expand his code using the DRY principle.

In this episode, Pat will use functions from the mikropml R package and data handling functions from dplyr in RStudio.


You can browse the state of the repository at the


If you haven’t been following along, you can get caught up by doing the following: