Tidy is in the eye of the beholder: How to use pivot_wider and pivot_longer (and kable)(CC040)

Опубликовано: 18 Октябрь 2020
на канале: Riffomonas Project
953
26

In this screencast tutorial, Pat Schloss shows how you can use dplyr's pivot_wider and pivot_longer to reshape your data to make it the appropriate level of tidiness for your application. We'll use pivot_wider to look at the number of ASVs for each region for each species and then output the data using the kable function from knitr. 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
3:13 Expanding the scope of issue 30
4:05 git log
5:01 Revisiting previous work on issue
7:45 pivot_longer refresher
11:13 pivot_wider introduction
12:53 Applying pivot_wider to issue 30
14:56 Diagnosing why we get multiple rows for the same species
22:01 Using values_fill with pivot_wider
24:32 kable introduction
29:03 Closing the issue
31:27 Conclusion

The accompanying blog post contains the exercises and solutions can be found at http://www.riffomonas.org/code_club/2...