# Calculate total flights by dayday_sum <- flights |>group_by(month, carrier) |>summarize(total_flights =n()) |>arrange(desc(total_flights)) ## total_flights is a new variable created
`summarise()` has grouped output by 'month'. You can override using the
`.groups` argument.
using plot 1 to make a bar graph that shows the x and y axes to show the carrier list and flight.
plot1 <- flights |>ggplot() +geom_bar(aes(x=flight, y=carrier,fill = origin ),position ="dodge", stat ="identity") +labs(fill ="total flights",y ="carriers list",title ="NYCflights 2023",caption ="Source:RITA, Bureau of transportation statistics, https://www.transtats.bts.gov/DL_SelectFields.asp?Table_ID=236")plot1
description of the bar graph
This bar graph represents the NYC flight in 2023 which starts from NYC domestic flights the destinations of different local destinations of the United States. The X-axis represents the number of flights each carrier takes throughout the year. The Y-axis represents each carrier that is serviced in three NYC state airports. The flight data shows all three airports of NYC listed EWR, JFK, and LGA.
plot1 <- flights |>ggplot() +geom_bar(aes(x=origin, y=flight, fill = carrier ),position ="dodge", stat ="identity") +labs(fill ="carriers",y ="number of flight",title ="NYC flights 2023",caption ="Source:RITA, Bureau of transportation statistics, https://www.transtats.bts.gov/DL_SelectFields.asp?Table_ID=236")plot1
description of the bar graph
This bar graph represents the NYC flight in 2023 which starts from NYC domestic flights the destinations of different local destinations of the United States. The X-axis represents the origin of the flight of three airports. The Y-axis represents the number of flights for each airport. The flight data shows all fourteen carriers that serve in NYC airports.