library(tidyverse)
library(nycflights13)Flights visualization
data <- nycflights13::flightsdata <- filter(data, origin=="JFK")p1 <- data |>
ggplot(aes(x=arr_delay-dep_delay, y=air_time, group_by(carrier), color=carrier)) +
labs(x = "Difference in Expected Flight Time (minutes)", y = "Air Time (Minutes)", title = "Expected Flight Time by Air Time for Flights Departing from JFK in 2013", color="Airline") +
geom_point(size=1)
p1 + theme_light()Warning: Removed 2200 rows containing missing values (`geom_point()`).
Essay
The visualization I have created compares the average delay while a plane is in the air with how long a flight is. What i expected to find was that as the air time increased, the extremes of delay would get wider as there is more time to gain and lose in the air. This graph indicates that that is correct other than outliers, as can be seen by the range of the dense areas. Surprisingly the flights to Hawaii (all the ones on top in teal) follow this trend when arriving early but don’t fit the trend for arriving late.