MENU

Fun & Interesting

Recreating a jitter plot made with R's ggplot2 two years later (CC243)

Riffomonas Project 1,866 lượt xem 2 years ago
Video Not Working? Fix It Now

Pat loves the ability to easily make jitter plots in R with tools from ggplot2. In this episode, Pat recreates his own figure from 2 years ago and then compares the code. How similar do you think the code will be? How similar would your code be after 2 years of learning and using more R? Watch as Pat uses magrittr aliases, map_dfr, if_else, ggplot2, geom_jitter, theme, scale_x_log10, scale_color_manual, and more. This episode is a bit different than Pat's other episodes and would love your feedback on this type of content!

You can find my blog post for this episode at https://www.riffomonas.org/code_club/2022-08-29-time-capsule.

#geom_jitter #ggplot2 #tidyverse #R #Rstudio #Rstats

Support Riffomonas by becoming a Patreon member!
https://www.patreon.com/riffomonas

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 Introduction
2:09 Reading in data files with map_dfr
12:50 Building initial jittered plot
14:04 Creating a log10 scale for x-axis
15:42 Setting the color and alpha of points
16:57 Altering the theme of the figure
19:26 Changing the amount of jitter
20:48 Reversing the order of datasets on y-axis
23:09 Final formatting and saving of figure
24:51 Comparing new code to old code

Comment