How to prevent text labels from overlapping in R with ggplot2 and ggrepel packages (CC150)
Автор: Riffomonas Project
Загружено: 30 сент. 2021 г.
Просмотров: 7 032 просмотра
A challenge of adding labels to a plot is how to prevent the labels from overlapping with each other. Thankfully, the ggrepel R package can be used with the ggplot2 package to produce an attractive figure without much trouble. The data depict the percentage of people in 15 countries who would be willing to receive the COVID-19 vaccine as of August and October of 2020.
Pat uses the geom_label_repel and #geom_text_repel functions from #ggrepel and the #geom_label function function from #ggplot2 and a variety of functions from the #dplyr, showtext, and ggtext packages in #RStudio. The accompanying blog post can be found at https://www.riffomonas.org/code_club/....
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.
R: https://r-project.org
RStudio: https://rstudio.com
Workshops: https://www.mothur.org/wiki/workshops
Here's a link for the chartr newsletter: https://www.chartr.co
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 Using ggrepel to separate text labels
1:59 Creating text labels with geom_label
3:15 Formatting the appearance of labels
6:35 Using ggrepel functions to minimize overlap
12:12 Critique of figure

Доступные форматы для скачивания:
Скачать видео mp4
-
Информация по загрузке: