Using ggplot2 to group x-axis discrete values into subgroups (CC133)

Описание к видео Using ggplot2 to group x-axis discrete values into subgroups (CC133)

When we group sets of variables into subgroups on the x-axis we signal to our audience that they need to compare the values within the grouping. But how do we do this with ggplot2? In this episode of Code Club, Pat will show how you can great four (!) layers of subgroups by using the ggplot2 facet_wrap function. At the end, we'll revisit our code and see how we can make it more DRY.

Pat will use functions from the #mikropml R package and the #facet_wrap function from #ggplot2 as well as functions from #dplyr and #purrr in #RStudio. The accompanying blog post can be found at https://www.riffomonas.org/code_club/....


If you're interested in taking an upcoming 3 day R workshop, email me at [email protected]!

R: https://r-project.org
RStudio: https://rstudio.com
Raw data: https://github.com/riffomonas/raw_dat...
Workshops: https://www.mothur.org/wiki/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 Introduction
1:58 Box and whisker plot
8:11 Changing order of training and testing data
9:10 Transition to point range plot
11:07 Creating multiple layers to x-axis labels with facet_wrap
16:53 Modifying y-axis range and label
17:34 Changing colors and legend labels
18:41 Add dashed horizontal line to indicate AUC for FIT alone
20:10 DRY: Replace repeated code with map_dfr
24:40 Recap

Комментарии

Информация по комментариям в разработке