flights <- nycflights13::flights %>%filter(!is.na(dep_delay), !is.na(air_time), !is.na(carrier))ggplot(flights, aes(x = dep_delay, y = air_time, color = carrier)) +geom_point(alpha =0.7, size =3) +labs(title ="Departure Delay vs. Airtime by Carrier",x ="Departure Delay (minutes)",y ="Airtime (minutes)" ) +scale_color_brewer(palette ="Set1") +theme_minimal()
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 scatter plot allows you to explore the relationship between departure delay and airtime for flights operated by different carriers. It can help identify if there are any patterns or differences in how various carriers manage their flights in terms of departure delay and airtime.
One aspect of the scatter plot that’s worth noting is the distribution of points for different carriers along the x-axis (departure delay) and y-axis (airtime). By examining the positions and patterns of points for each carrier, you can gain insights into how different airlines handle departure delays in relation to the duration of their flights.