Using vegan to calculate alpha diversity metrics within the tidyverse in R (CC196)
Channel: Riffomonas Project
Date: 2022-03-17

Among the useful tools in the vegan R package are functions for calculating alpha diversity metrics and indices. In this episode of Code Club, Pat shows how to create our own versions of these functions and how we can implement either version in a group_by / summarize pipeline using dplyr. We'll also take a look at whether there is an effect of sampling effort on the observed richness, shannon diversity, and simpson diversity. He'll show how to synthesize and visualize the data using tools from vegan, dplyr, ggplot2 and other tidyverse packages.

You can find my blog post for this episode at https://www.riffomonas.org/code_club/2022-03-17-alpha-diversity. The data were generated in our Kozich et al. 2013 paper (http://doi.org/10.1128/AEM.01043-13) using samples from the Schloss et al. 2012 paper (http://doi.org/10.4161/gmic.21008).

#rarefaction #vegan #R #Rstudio #Rstats

Want more practice on the concepts covered in Code Club? You can sign up for my weekly newsletter at https://shop.riffomonas.org/youtube to get practice problems, tips, and insights.

If you're interested in taking an upcoming 3 day R workshop be sure to check out our schedule at https://riffomonas.org/workshops/

You can also find complete tutorials for learning R with the tidyverse using...
Microbial ecology data: https://www.riffomonas.org/minimalR/
General data: https://www.riffomonas.org/generalR/

0:00 Difference between alpha and beta diversity
3:22 Writing our own functions to calculate alpha diversity
10:20 Plotting alpha diversity as a function of sampling effort
11:42 Is there an influence of sampling effect?
14:03 Implementing and comparing vegan version of functions