Making Swimmer Plots for Longitudinal Data with {ggplot2}
Channel: R Consortium
Date: 2022-09-09

From R/Medicine Conference 2022 

Kat Hoffman, Research Biostatistician III at Weill Cornell Medicine

Main Sections

0:00 Introduction
0:28 Swimmer plot
1:24 Do we really have to hand-code this?
2:16 Step 1: Long-form data set
3:44 Step 2: Long-form data for plotting
6:55 Step 3: Plot all your geometries 
8:24 Step 4: Modify geom_* layers
9:48 Step 5: Add colors and legend 
12:26 Step 6: Modify colors
14:34 Step 7: Modify legend using override.aes()
17:05 Step 8: Make minor theme edits 
17:37 In summary
18:21 Thank you!



More Resources 

Main Site: https://www.r-consortium.org/  
News: https://www.r-consortium.org/news  
Blog: https://www.r-consortium.org/news/blog  
Join: https://www.r-consortium.org/about/join  
Twitter: https://twitter.com/Rconsortium  
LinkedIn: https://www.linkedin.com/company/r-consortium/