Showing groups on a scatter plot for an ordination using ggplot2 (CC079)
Channel: Riffomonas Project
Date: 2021-03-11

Showing groups in a scatter plot to indicate the region covered by points from different groups can help your audience understand whether you see structure in your data. In this episode of Code Club, I'll show a variety of approaches you can take to show which points belong to different groups in a scatter plot. We'll cover plotting a centroid, adding rays out from the centroid, ellipses, and a 2 dimensional density plot (whoa!).

Pat will use RStudio and functions from the ggplot2 package and other packages from the tidyverse. The accompanying blog post can be found at https://www.riffomonas.org/code_club/2021-03-11-ellipses.

Do you have a figure that you would like to receive a critique or help improving? Let me know and I'd be happy to arrange a guest appearance!

If you're interested in taking an upcoming 3 day R workshop, email me at riffomonas@gmail.com!

R: https://r-project.org
RStudio: https://rstudio.com
Raw data: https://github.com/riffomonas/raw_data/releases/latest
Workshops: https://www.mothur.org/wiki/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 Introduction
1:35 Pre-attentive attributes
3:03 Grouping as a pre-attentive attribute
5:50 Rant about Rstudio
8:06 Indicating the centroid
12:20 Star plot
18:35 Adding ellipses
24:38 2D Density plot
27:41 Conclusion