How to Create Dumbbell Plots with R & ggplot2 | A Step-by-Step Tutorial

preview_player
Показать описание
The best chart type to compare two values across multiple groups are dumbbell plots. They are muuuch better than the frequently used paired bar charts. In this video, I give you a step-by-step ggplot guide so that you can make better charts for comparisons.

SUPPORT THIS CHANNEL

MORE VIDEOS

MORE CONTENT

#datavisualization #ggplot2 #rstats
Рекомендации по теме
Комментарии
Автор

My goat - your channel is a goldmine of R knowledge

toad
Автор

This is amazing the production quality is so good, the cadence is perfect, thank you!!!! Your channel is a goldmine

alexis
Автор

Thank you for this! Your videos are very helpful and I appreciate the subtle humor, besides the technical brilliance! Looking forward to many more! Good luck!

raould
Автор

Technical prowess in creating this dumbbell is astonishing. Before I watched this tutorial, I assumed Albert would rely on geom_dumbbell ( ). Instead, he demonstrated the use of geom_line and geom_point to produce the same result. Next, a found a most creative way of using a dummy variable whose direction changed in light of the difference in life expectancy in two years. In this regards, I was surprised that calling for a particular cell in a mutate command could actually perform the role of a function (e.g., life_exp[2]). I always assume it would be a fixed value (e.g., Albania's life expectancy in 2007 -76.423 years-). However, I found confusing splitting the mutate function for creating and ordering change life expectancy. Instead, I decided to try this variation instead : mutate(change_life_exp = diff(life_exp), .by = country,
order_dumbbells = if_else(change_life_exp < 0, -1, 1) * life_exp[2]).

albertocabrera
Автор

Love your vids. I am so interested in creating a good way to communicate stat sig difference in means with some sort of overlapping confidence bars, but this has been surprisingly hard to derive. Any thoughts?

petercourtney
Автор

Hi Albert,

Can you tell me what is the best way to get nice looking conditional formatting in my tables?
I want a clear gradation in color (ie several different shades of green/red).
I want to be able to set conditions / midpoints if possible (for example, 0 always appears as white).

If it helps to clarify, my typical workflow uses Rmarkdown and KableExtra so I'm hoping to add conditonal formatting to those tables.

Jimson-wxuq