How to Make an Upset Plot in R - Demonstration
Channel: Monika Wahi
Date: 2022-04-03

*Note: I may be compensated, but you will not be charged, if you click on the links below.

In this video, Monika Wahi shows you how to use the package UpSetR to make an upset plot showing patterns of co-morbidities in patients in R. See her blog post here: https://buff.ly/3DAtZXM 
Files on Github: https://buff.ly/3EpJF0d
UpSetR package doco on CRAN: https://cran.r-project.org/web/packages/UpSetR/index.html 

💡 If you are a public health practitioner looking for a targeted program for enhancing your data science skills, please sign up to participate in my 30-minute market research interview so I can get your feedback: https://buff.ly/3UnLqmq    

WANT TO SUPPORT MONIKA ON SOCIAL MEDIA?
❤️Subscribe to Monika's YouTube channel: https://buff.ly/2W6ijuc   
🧡Follow/connect with Monika on LinkedIn: https://www.linkedin.com/in/dethwench/ 
💛Follow Monika on Twitter: https://twitter.com/PHExaminer 
💚Try Monika’s courses on LinkedIn Learning: https://linkedin-learning.pxf.io/NKN0JO 
💙Try Monika's boutique research methods and data science courses here: https://buff.ly/3zM243P

Timestamps and links as the come up are below:
00:15 Explanation of use-case for example upset plot
00:30 More on BRFSS data: https://buff.ly/311uQ1y 
01:14 Interpreting the plot
02:17 More on using RDS format in R: https://buff.ly/3DC9tG3 
02:32 SAS macro videos: https://buff.ly/3xDsQMe 
02:53 Reading in file with readRDS(), visualizing column names with colnames(), and using head() to look at the top 5 rows
03:18 Discussion of column headers as labels in the resulting plot
03:44 Structure of data – set of binary flags
04:15 Annotated plot with options that can be set
05:02 Titles and tick labels that can be configured
05:30 Colors that can be configured
05:58 Best approach for setting options for plots in R
06:07 Text scale options vector cheat sheet
06:45 Creating text_scale_options vectors
07:06 Creating variables to set colors
07:33 Discussion of mb.ratio option
08:26 Rationale for making multiple vectors as alternatives to set one option
08:50 Creating set_vars vector
09:20 Calling libraries UpSetR and ggplot2
09:32 Focus on plot code
10:06 Running the plot code

How to Make an Upset Plot in R - Demonstration