library(tidyverse)
## ── Attaching core tidyverse packages ──────────────────────── tidyverse 2.0.0 ──
## ✔ dplyr     1.1.0     ✔ readr     2.1.4
## ✔ forcats   1.0.0     ✔ stringr   1.5.0
## ✔ ggplot2   3.4.1     ✔ tibble    3.1.8
## ✔ lubridate 1.9.2     ✔ tidyr     1.3.0
## ✔ purrr     1.0.1     
## ── Conflicts ────────────────────────────────────────── tidyverse_conflicts() ──
## ✖ dplyr::filter() masks stats::filter()
## ✖ dplyr::lag()    masks stats::lag()
## ℹ Use the ]8;;http://conflicted.r-lib.org/conflicted package]8;; to force all conflicts to become errors
library(nycflights13)
library(dplyr)
library(ggplot2)

# Filtering data to only include delayed flights and select carrier and dep_delay columns
delayed_flights <- filter(flights, dep_delay > 0) %>%
  select(carrier, dep_delay)

# Creating a boxplot
ggplot(delayed_flights, aes(x = carrier, y = dep_delay, fill = carrier)) +
  geom_boxplot() +
  scale_fill_brewer(palette = "Set1") +
  xlab("Carrier") +
  ylab("Departure Delay (minutes)") +
  ggtitle("Distribution of Flight Departure Delays by Carrier from NYC Airports (2013)") +
  theme(plot.title = element_text(hjust = 0.5))
## Warning in RColorBrewer::brewer.pal(n, pal): n too large, allowed maximum for palette Set1 is 9
## Returning the palette you asked for with that many colors

This vertical box plot seems to show all the departure delays made by carrier from all NYC airports in 2013. One aspect of the graph that sticks out to me is how many times some carriers had delays that it seems very frequent and could take any amount of time like the carriers DL and AA.Some carriers also have longer median delays like EV than HA. Overall, it despite some anomallies and outliers, this graph shows which carriers might be more dependable compared to others when it comes to departure delays.