plot1 <- org_carrier_set |>ggplot() +geom_bar(aes(x =fct_reorder(carrier, - mean_dep_delay), y = mean_dep_delay, fill = better_worse),position ="dodge", stat ="identity") +labs(y ="Carrier's Averge Departure Delay(min) ",x ="Carriers",title ="Average Departure Delays Compared by Carrier",subtitle ="In the Year 2023", fill ="Better or Worse Than\nAverage Departure Delay of All Flights(min)",caption ="Source: The Bureau of Transportation Statistics") +scale_fill_manual(values =c('better'='blue', 'worse'='red')) +theme(axis.text.x =element_text(angle =45, hjust =1))plot1
plot2 <- org_carrier_set |>ggplot() +geom_bar(aes(x =fct_reorder(carrier, - mean_arr_delay), y = mean_arr_delay, fill = better_worse_2),position ="dodge", stat ="identity") +labs(y ="Carrier's average Arrival Delay(min)",x ="Carriers",title ="Average Arrival Delays Compared by Carrier",subtitle ="In the Year 2023", fill ="Better or Worse Than\nAverage Arrival Delay of all flights(min)",caption ="Source: The Bureau of Transportation Statistics") +scale_fill_manual(values =c('better'='blue', 'worse'='red')) +theme(axis.text.x =element_text(angle =45, hjust =1))plot2
These two bar charts I have coded compare the average departure/arrival delays of the flights per each carrier, and then, through the color, shows whether the carrier’s average departure/arrival delay was above or below (better or worse) the average delay of all the flights in the data set combined. Something I would like to highlight is that, according to the graphs, it seems in 2023 the price point of airlines didn’t have the type of relationship to promptness of flights one might have expected. Allegiant Airlines has both the least departure and arrival delays, an airline that is known for it’s very discounted prices. Of course, the same is true for the worst airline in both categories, but overall it’s mixed, and I thought that was interesting. Something I would have liked to have been able to do, if I could have figured out how, is to show how much better or worse each carrier’s average was compared to the overall average. For example, finding a way to highlight where the overall average departure/arrival delay sits on the actual graph (like a horizontal line on y=13 or y=4), would give more meaningful information to a viewer, allowing someone to see how close a carrier’s bar is to that line. I think right now, the knee jerk reaction I have to looking at these graphs is that the bigger the blue bars, the better the delay is as compared to the overall average, rather than the opposite, which is what is really true. As soon as you look closer and read the values on the y axis, I think it makes sense, but I also think being able to delineate where the overall average departure/arrival delay would sit on the graph, would make not just the colors easier to understand, but the graph as a whole.