## filter the dataset and remove the missing data flights_filtered <- flights |>select(carrier,dest,dep_delay) |>filter(!is.na(dep_delay), dest =="CLT")averageDep_delay <- flights_filtered|>group_by(carrier)|>summarize(averageDep_delay =mean(dep_delay))## make a bargraph showing the average departure delay by carrier to CLTplot1 <-ggplot(averageDep_delay, aes(x = carrier, y = averageDep_delay, fill = carrier)) +geom_bar(stat ="identity") +labs(title ="Average Departure Delay in Flights to CLT by Airlines",x ="Airlines", y ="Average Departure Delay in Minutes",fill ="Airlines",caption ="Data source: nycflights13 Dataset:Flights") +theme_minimal() +scale_fill_manual(values =c("#B7D3DF", "#C9BBCF", "#898AA6", "#957DAD", "#85586F", "#E0BBe4","#5e6472"))plot1
The visualization shows the average departure delay in flights to Charlotte Douglass International Airport (CLT) by airlines. Each bar represents an airline and the height of each bar shows the average delay, in minutes. The design of the graph uses colors for each airline. One aspect of the graph is the varying delays among airlines with some experiencing longer delays than others. This information can be vital for both travelers and airlines in making decisions about flights, to CLT. ** CHATGPT was used to look/help fix errors and to also make suggestions.