How to Make Box Plots in R - Demonstration
Channel: Monika Wahi
Date: 2022-04-02

*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 make different types of box plots in R. See her blog post here: https://buff.ly/3uK49fN 
Files on Github: https://buff.ly/3xF6H27
Data from American Hospital Directory: https://www.ahd.com/ 
Monika’s livestream recording doing box plots: https://youtu.be/ZSFixsjy0Kw 

💡 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:18 Description of data we will use for the demonstration
00:58 Explanation of MAHosp data in Excel
01:28 Comment on datatypes. See Monika fight with datatypes when making box plots in this livestream recording: https://youtu.be/ZSFixsjy0Kw
02:10 Explanation of CityCompare data in Excel
03:09 Reading in MAHosp *.csv using read.csv()
03:54 Walking through base R command boxplot()
04:17 Example of a sparse base R box plot
04:45 Walking through modified code for base R box plot – adding options
05:16 Example of a base R box plot with some options
05:30 Discussion of being an R snob, and choosing ggplot2 over base R for plotting
06:08 Calling up ggplot2 library
06:21 Walking through the most minimal ggplot2 code needed to make a box plot, using geom_boxplot()
06:38 What happens if you run the minimal ggplot2 code without the geom_boxplot() command
07:16 Example of plain ggplot2 box plot from geom_boxplot()
07:50 Walking through modified ggplot2 code that adds options, including coord_flip() and theme_classic()
08:41 Example of modified ggplot2 box plot
09:10 Reading in CityCompare dataset with read.csv()
09:22 Walking through changing base R box plot code to accommodate groupings. You need to add an equation (y ~ x).
09:53 Example of base R box plot modified to add a grouping variable
10:02 Walking through changing ggplot2 box plot code to accommodate groupings. You need to add the grouping variable as the y in the aes argument.
10:40 Example of ggplot2 box plot modified to add a grouping variable

How to Make Box Plots in R - Demonstration