You can create a jitter plot or stripchart with R's ggplot2 package using the geom_jitter function. A jitter plot or strip chart are the same thing and they allow you to depict individual values of a continuous variable against categorical variable. To provide context, we can also use stat_summary to include a marker to indicate the median value of the continuous variable. In this episode of Code Club, Pat will show you how to create a jitter plot using geom_jitter and stat_summary from ggplot2.
Pat will use RStudio and functions from the #ggplot2 package including #geom_jitter and #stat_summary and other packages from the tidyverse. The accompanying blog post can be found at https://www.riffomonas.org/code_club/2021-04-09-stripchart.
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
[email protected]!
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
2:12 Creating a stripchart/jitter plot
5:18 Setting the random number generator
8:05 Dealing with over plotting of points
11:14 Indicating the median
14:10 Critique of figure
16:51 Conclusion