Functional Programming

for educational data science

Welcome to the third course in the Educational Data Science specialization. This course builds upon the content covered in the first two courses, with a specific focus on becoming a better programmer and improving workflows in statistical computing with R. Students will continue to work with the tidyverse suite of packages, with a emphasis on {purrr} for functional programming. At its core, functional programming is a technique to iterate a function over a vector, or set of vectors, to complete repetitive tasks. We will compare and contrast {purrr} functions with base R approaches, including for loops and the apply family of functions. Functional programming helps reduce redundancies in code, making it more efficient and, often, more readable. The course will also cover writing custom functions, which can also help in completing repetitive tasks, but can also extend the functionality of R, and is a key component of functional programming. The course concludes with an introduction to shiny for building interactive applications which, although somewhat outside of the scope of functional programming, requires using and writing functions.