Repeating and parallelizing a function in R with the purrr and furrr packages (CC192)

March 3, 2022 • PD Schloss • 1 min read

In this episode Pat writes a function in R that needs to be repeated for different input values. He shows how to do this with purrr’s map_dfr and then speeds things up by parallelizing it with furrr’s future_map_dfr. The specific question in this episode is how the sampling depth of communities impacts pairwise Bray-Curtis distances calculated using avgdist from vegan. He’ll show how to synthesize and visualize the data using tools from dplyr, ggplot2, and other tidyverse packages.

Code

You can browse the state of the repository at the