Using nest, mutate, map, and unnest in R to analyze data frames within data frames (CC056)
Channel: Riffomonas Project
Date: 2020-12-14

The group_by/summarize idiom in dplyr is very powerful. Unfortunately, it only works if the summarize functions create a single output value. In this episode, I show how to use nest, mutate, map, and unnest to work with functions that output multiple output values. This episode is part of a larger arc of episodes investigating the sensitivity and specificity of amplicon sequence variants (ASVs), also known as exact sequence variants (ESVs). ASVs are growing in popularity for analyzing microbial communities using 16S rRNA gene sequences. Pat demonstrates these concepts by live coding at the command line interface using RStudio, GitHub Flow, and make.

0:00 Introduction
2:28 Setting up the problem
7:08 Limits of group_by/summarize
8:56 nest
10:12 mutate w/ map
12:31 unnest
13:58 Scaling up
16:00 Review
18:18 Conclusion

The accompanying blog post contains the exercises and solutions can be found at http://www.riffomonas.org/code_club/2020-12-14-nest-mutate-unnest