Adding log-scaled tick marks to an axis with ggplot2 in R (CC325)

  Рет қаралды 452

Riffomonas Project

Riffomonas Project

Күн бұрын

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

Пікірлер: 8
@lucasamoroso92
@lucasamoroso92 Ай бұрын
Pat, i'm loving this series! Always learning something new 🙏 Thanks for that!
@Riffomonas
@Riffomonas Ай бұрын
wonderful - thanks for watching! 🤓
@pimaniye41
@pimaniye41 Ай бұрын
This channel helped me with my first r package and ever since it is the most useful channel for me in R. Always explaining unique stuff that you wont find without a niche stackoverflow question :) Thanks for the videos
@Riffomonas
@Riffomonas Ай бұрын
My pleasure - thanks so much for watching! 🤓
@OlawaleQuadriOgunsola
@OlawaleQuadriOgunsola Ай бұрын
Nice video. Another way to get the variable names instead of using count is using "distinct" option.
@Riffomonas
@Riffomonas Ай бұрын
thanks! for some reason, my go to is always count rather than distinct. not sure why 🤓
@djangoworldwide7925
@djangoworldwide7925 Ай бұрын
Pat youre beautiful (❤️) but can you please reduce the size of your square? Or make the border blur? It hides parts of the code/ viz. As always, love how you implement styling and advanced features of ggplot to reproduce figures you found. It is so helpful and insightful
@Riffomonas
@Riffomonas Ай бұрын
There's just not enough real estate on the screen :) I'm trying to get to a png quicker and toggle back and forth between that and the code
小丑教训坏蛋 #小丑 #天使 #shorts
00:49
好人小丑
Рет қаралды 54 МЛН
Try this prank with your friends 😂 @karina-kola
00:18
Andrey Grechka
Рет қаралды 9 МЛН
Enceinte et en Bazard: Les Chroniques du Nettoyage ! 🚽✨
00:21
Two More French
Рет қаралды 42 МЛН
Tuna 🍣 ​⁠@patrickzeinali ​⁠@ChefRush
00:48
albert_cancook
Рет қаралды 148 МЛН
Module 2: Testing Part 2
39:11
Collin Philipps
Рет қаралды 37
Marxism lecture 4: Hegel Part I - The Laws of Logic
52:13
Red Star
Рет қаралды 8 М.
Lecture 3 | Loss Functions and Optimization
1:14:40
Stanford University School of Engineering
Рет қаралды 905 М.
Pre-Algebra Final Exam Review
1:56:08
The Organic Chemistry Tutor
Рет қаралды 337 М.
小丑教训坏蛋 #小丑 #天使 #shorts
00:49
好人小丑
Рет қаралды 54 МЛН