CDVS Workshop: R for data science: custom functions and iteration



Herndon, Joel


event sponsored by

Libraries &

Research Computing, and Social Science Research Institute (SSRI)


Center for Data and Visualization Sciences Workshop Series


John Little

Part of the Rfun series. R and the Tidyverse are a data-first coding language that enables reproducible workflows. This Introduction to iteration and custom functions uses a case-study approach to iterating over rows in a data frame using the {purrr} package. {purrr} is an efficient and easier alternative to writing FOR loops. Prerequisite: familiarity with Tidyverse and ggplot (See Rfun quickStart). This workshop will explore efficient alternatives to for-loops by leveraging custom functions and the purrr library functions, e.g. map(). With these skills you can organize data frames for iteration. For example, when ingesting multiple CSV files or multiple Excel worksheets. You will learn nesting techniques that foster iteration. You'll be able to organize data frames that contain models, and visualizations.


Workshop/Short Course, Research, and Technology