Це відео не доступне.
Перепрошуємо.
Creating a barplot with error bars using ggplot2 (CC088)
Вставка
- Опубліковано 7 сер 2024
- In this episode of Code Club, Pat shows how to create a barplot with error bars using the geom_col and geom_errorbar functions from ggplot2. Along the way, he'll discuss the problems with bar plots and why these graphs are best avoided.
Pat will use RStudio and functions from the ggplot2 package and other packages from the tidyverse. The accompanying blog post can be found at www.riffomonas.org/code_club/....
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!
PLOS Biology article on barplots: journals.plos.org/plosbiology...
R: r-project.org
RStudio: rstudio.com
Raw data: github.com/riffomonas/raw_dat...
Workshops: www.mothur.org/wiki/workshops
You can also find complete tutorials for learning R with the tidyverse using...
Microbial ecology data: www.riffomonas.org/minimalR/
General data: www.riffomonas.org/generalR/
0:00 Introduction
2:23 Critiquing an old figure
7:33 Recreating old figure
11:20 Improving appearance of figure
18:07 Add N to labels
21:00 Conclusion
Be sure to check out the PLOS Biology article I mentioned. What do you think of their arguments? journals.plos.org/plosbiology/article?id=10.1371%2Fjournal.pbio.1002128
I highly appreciate your tutorial, professor. My sincere gratitude for the lesson you have shared with us. Greetings from Mexico.
My pleasure! Thanks for watching 😊
great tip using the ggtext for the markdown in the axis, learning a ton with your videos!
Thanks! I’ve really grown to love ggtext and glue for this type of stuff
Great video, thanks! Recently I have been thinking about how to overcome this issue with barplots in my own figures - currently I am making boxplots with geom_point overlaid to better demonstrate the distribution of the samples, but when I have figures with a lot of data points it can look a bit messy and harder to interpret. Looking forward to a future episode on bar plot alternatives!
Hey Grace - I agree. It isn’t easy and there’s probably no perfect choice for larger datasets ... but I think most are better than bar charts with +/- se 😂
Excellent tutorial the element.markdown feature is really cool and handy!
It's great, isn't it?! I think it's also going to be super handy for things like bacterial names on axes
Thanks, absolutely useful to analyze and visualize my data related to the macro faunal abundance in a lagoon system.
Fantastic!
Now I know how to fix a broken barplot.Glue it. :)THANK YOU VERY MUCH.
My pleasure!
Dude, most of my master's degree has been online due to Covid. You're helping me a great deal with these tutorials and your posts on the Mothur forum! Stoked to see what you recommend instead. Maybe errorplots?
Ugh, that's brutal! Glad to be able to help out. The next 3-4 episodes will be alternatives so stay tuned :)
Thank you for this!! Very informative.
Thanks for watching!
great@
There is a space between the x axis line and bins; how to get rid of this space?
Thanks for watching! You can use expand=c(0,0) in scale_y_continuous
Totally agree with you, I do not like bar plot either. But the real problem is the original data they use, very less chance to get them even by a kind ask with an email. Open science and reproducible research is still a long way to go.
Baby steps!
Thanks Pat. I just think that SE is not the right thing to show in dinamite plots (that already aren't a great plot for means). SE is the standard deviation of the means of samples taken form the same population, so, it is not appropriate to show the variation for 1 single (or pooled) sample. Don't you agree?
Can I talk with you about my plot?