Рет қаралды 452
Pat recreates a figure published in mBio as a line plot with data using the geom_line and geom_errorbar functions from ggplot2 in R and composes them together using patchwork. Along the way he uses filter, summarize, geom_errorbar, geom_line, labs, scale_color_manual, scale_y_log10, guide_axis_logticks, coord_cartesian, and theme. You can find the code he developed in this episode at www.riffomonas.... The original paper is in an open access journal and can be found at journals.asm.o.... The newsletter describing how he would go about generating the figure can be found at shop.riffomona....
If you have a figure that you would like to see me discuss in a future newsletter and episode of Code Club, email me at pat@riffomonas.org!
Want more practice on the concepts covered in Code Club? You can sign up for my weekly newsletter at shop.riffomona... to get practice problems, tips, and insights. If you're interested in purchasing a video workshop be sure to check out riffomonas.org...
Support Riffomonas by becoming a Patreon member!
/ riffomonas
You can also find complete tutorials for learning R with the tidyverse using...
Microbial ecology data: www.riffomonas...
General data: www.riffomonas...
If you want to cite this video, please consider citing journals.asm.o...
0:00 Introduction
3:47 Generating basic line plot with error bars
6:13 Modifying appearance of legend and colors
11:57 Formatting the y-axis to be log scaled
19:44 Adding and formatting title for each plot
20:48 Create function to generate each subplot
23:05 Assembling panels with patchwork
24:58 Adjusting formatting of figure to match original
33:21 Adjusting width of error bar staple