`summarise()` has grouped output by 'hour'. You can override using the
`.groups` argument.
carrier_colors <-scale_color_manual(values =c("AA"="blue","B6"="green","DL"="orange","UA"="red","WN"="purple"))ggplot(delay_by_hour, aes(x = hour, y = Avg_Departure_Delay, color = carrier)) +geom_line() +labs(title ="Average Departure Delay by Hour of the Day",x ="Hour of the Day",y ="Average Departure Delay (minutes)" ) + carrier_colors +theme_minimal()
The line plot above visualizes the average departure delay for flights over the course of the day, with different colors representing different airlines. Each line represents a carrier, and the x-axis represents the hour of the day, while the y-axis represents the average departure delay in minutes.
One aspect of the plot to highlight is the use of different colors for each carrier, making it easy to distinguish between them.