Introduction

The dataset encompasses variables pertaining to various aircraft and includes detailed records on the landing count and landed weight of 107 distinct operating airlines, each associated with 97 unique published airlines. This comprehensive data offers valuable insights into flight statistics and provides extensive information about the diverse range of aircraft involved.

Key Findings

Analysis

Import Data

airlinedf <- read.csv("~/Case Studies/Airlines/cleaned_air.csv")

Load Library

library('dplyr')
library('magrittr')
library('ggplot2')
library('tidyr')
library('patchwork')

Data Dleaning

## add underscores into column names to separate words 
colnames(airlinedf) <- gsub("\\.", "_", colnames(airlinedf))
## convert all column names to lower case
colnames(airlinedf) <- tolower(colnames(airlinedf))
## check for duplicates
sum(duplicated(airlinedf))
## [1] 9206
## see where the duplicates are 
dupes <- duplicated(airlinedf)

head(dupes)
## [1] FALSE FALSE FALSE FALSE FALSE FALSE
## remove duplicates
airlinedf <- airlinedf %>%  
    distinct()
## check for NAs 
sum(is.na(airlinedf))
## [1] 0
## trim words 
airlinedf <- airlinedf %>% 
    mutate(across(where(is.character), trimws))
# see structure of data 
str(airlinedf)
## 'data.frame':    12839 obs. of  12 variables:
##  $ operating_airline          : chr  "SkyWest Airlines" "Air Canada" "Japan Airlines" "COPA Airlines, Inc." ...
##  $ operating_airline_iata_code: chr  "OO" "AC" "JL" "CM" ...
##  $ published_airline          : chr  "United Airlines" "Air Canada" "Japan Airlines" "COPA Airlines, Inc." ...
##  $ published_airline_iata_code: chr  "UA" "AC" "JL" "CM" ...
##  $ geo_summary                : chr  "International" "International" "International" "International" ...
##  $ geo_region                 : chr  "Canada" "Canada" "Asia" "Central America" ...
##  $ landing_aircraft_type      : chr  "Passenger" "Passenger" "Passenger" "Passenger" ...
##  $ aircraft_body_type         : chr  "Regional Jet" "Narrow Body" "Wide Body" "Narrow Body" ...
##  $ aircraft_manufacturer      : chr  "Bombardier" "Airbus" "Boeing" "Boeing" ...
##  $ aircraft_model             : chr  "CRJ2" "A320" "B773" "B739" ...
##  $ landing_count              : int  30 125 30 3 16 9 30 60 283 29 ...
##  $ total_landed_weight        : int  1410000 17787978 16620000 491700 7301712 3710376 12235650 8778000 40901600 16066000 ...

Data Visualization and Summary Tables

summary(airlinedf)
##  operating_airline  operating_airline_iata_code published_airline 
##  Length:12839       Length:12839                Length:12839      
##  Class :character   Class :character            Class :character  
##  Mode  :character   Mode  :character            Mode  :character  
##                                                                   
##                                                                   
##                                                                   
##  published_airline_iata_code geo_summary         geo_region       
##  Length:12839                Length:12839       Length:12839      
##  Class :character            Class :character   Class :character  
##  Mode  :character            Mode  :character   Mode  :character  
##                                                                   
##                                                                   
##                                                                   
##  landing_aircraft_type aircraft_body_type aircraft_manufacturer
##  Length:12839          Length:12839       Length:12839         
##  Class :character      Class :character   Class :character     
##  Mode  :character      Mode  :character   Mode  :character     
##                                                                
##                                                                
##                                                                
##  aircraft_model     landing_count    total_landed_weight
##  Length:12839       Min.   :   1.0   Min.   :     6850  
##  Class :character   1st Qu.:  18.0   1st Qu.:  3720277  
##  Mode  :character   Median :  44.0   Median : 10410400  
##                     Mean   : 165.6   Mean   : 23821308  
##                     3rd Qu.: 147.0   3rd Qu.: 26255000  
##                     Max.   :2245.0   Max.   :273042000

Airline

# distinct number of operating airlines 
length(unique(airlinedf$operating_airline))
## [1] 107
# distinct number of published airlines 
length(unique(airlinedf$published_airline))
## [1] 97

Number of Distinct Operating Airline under Each Published Airline

airline <- airlinedf %>% 
    group_by(published_airline) %>% 
    summarise(airline_count = n_distinct(operating_airline)) %>% 
    arrange(desc(airline_count))
airline 
## # A tibble: 97 × 2
##    published_airline                        airline_count
##    <chr>                                            <int>
##  1 Delta Air Lines                                      6
##  2 American Airlines                                    5
##  3 Air Canada                                           3
##  4 Alaska Airlines                                      3
##  5 United Airlines                                      3
##  6 Frontier Airlines                                    2
##  7 US Airways                                           2
##  8 United Airlines - Pre 07/01/2013                     2
##  9 ABC Aerolineas S.A. de C.V. dba Interjet             1
## 10 ABX Air                                              1
## # ℹ 87 more rows

Top 10 Operating Airlines by Landing Count and Landed Weight

top10_O_airlines <- airlinedf %>% 
    group_by(operating_airline) %>% 
    summarise(total_landing_count = sum(landing_count), .groups = 'drop') %>% 
    slice_max(total_landing_count, n = 10) %>% 
    arrange(desc(total_landing_count))

top10_O_airlines2 <- airlinedf %>% 
    group_by(operating_airline) %>% 
    summarise(total_landed_weight = sum(total_landed_weight), .groups = 'drop') %>% 
    slice_max(total_landed_weight, n = 10) %>% 
    arrange(desc(total_landed_weight))

OAcolours <- c("tan4", "wheat2", "skyblue4", "indianred4", "paleturquoise4", 
               "salmon4", "lightsteelblue3", "lightyellow2", "honeydew3", "burlywood3")

p1 <- ggplot(top10_O_airlines, aes(x =  operating_airline, y = total_landing_count, fill = operating_airline)) +
        geom_bar(stat = "identity", colour = "grey35") +
        scale_fill_manual(values = OAcolours) +
        labs(x = "Operating Airlines", y = "Total Landing Count", fill = "Operating Airlines",
             title = "Bar Plot of the Top 10 Operating Airlines (Total Landing Count)") +
        theme(plot.background = element_rect(fill = "grey90"),
              panel.background = element_rect(fill = "seashell2"),
              panel.grid = element_line(colour = "grey90"),
              legend.background = element_rect(fill = "grey90"),
              axis.text.x = element_text(angle = 45, hjust = 1, vjust = 1))
              

p2 <- ggplot(top10_O_airlines2, aes(x =  operating_airline, y = total_landed_weight, fill = operating_airline)) +
        geom_bar(stat = "identity", colour = "grey35") +
        scale_fill_manual(values = OAcolours) +
        labs(x = "Operating Airlines", y = "Total Landed Weight", fill = "Operating Airlines",
             title = "Bar Plot of the Top 10 Operating Airlines (Total Landed Weight)") +
        theme(plot.background = element_rect(fill = "grey90"),
              panel.background = element_rect(fill = "seashell2"),
              panel.grid = element_line(colour = "grey90"),
              legend.background = element_rect(fill = "grey90"),
              axis.text.x = element_text(angle = 45, hjust = 1, vjust = 1))

combined1 <- p1 + p2 + plot_layout(ncol = 2)
combined1

Top 10 Published Airlines by Landing Count and Landed Weight

top10_P_airlines <- airlinedf %>% 
    group_by(published_airline) %>% 
    summarise(total_landing_count = sum(landing_count), .groups = 'drop') %>% 
    slice_max(total_landing_count, n = 10) %>% 
    arrange(desc(total_landing_count))

top10_P_airlines2 <- airlinedf %>% 
    group_by(published_airline) %>% 
    summarise(total_landed_weight = sum(total_landed_weight), .groups = 'drop') %>% 
    slice_max(total_landed_weight, n = 10) %>% 
    arrange(desc(total_landed_weight))

PAcolours <- c("bisque3", "lemonchiffon", "dodgerblue4" , "indianred4", "lightcyan3",
               "lightcoral", "slategray3", "wheat2", "lightblue", "tan4")

p3 <- ggplot(top10_P_airlines, aes(x =  published_airline, y = total_landing_count, fill = published_airline)) +
        geom_bar(stat = "identity", colour = "grey35") +
        scale_fill_manual(values = PAcolours) + 
        labs(x = "Published Airlines", y = "Total Landing Count", fill = "Published Airlines",
             title = "Bar Plot of the Top 10 Published Airlines (Total Landing Count)") +
        theme(plot.background = element_rect(fill = "grey90"),
              panel.background = element_rect(fill = "seashell2"),
              panel.grid = element_line(colour = "grey90"),
              legend.background = element_rect(fill = "grey90"),
              axis.text.x = element_text(angle = 45, hjust = 1, vjust = 1))

p4 <- ggplot(top10_P_airlines2, aes(x =  published_airline, y = total_landed_weight, fill = published_airline)) +
        geom_bar(stat = "identity", colour = "grey35") +
        scale_fill_manual(values = PAcolours) +
        labs(x = "Published Airlines", y = "Total Landed Weight", fill = "Published Airlines",
             title = "Bar Plot of the Top 10 Published Airlines (Total Landed Weight)")+
        theme(plot.background = element_rect(fill = "grey90"),
              panel.background = element_rect(fill = "seashell2"),
              panel.grid = element_line(colour = "grey90"),
              legend.background = element_rect(fill = "grey90"),
              axis.text.x = element_text(angle = 45, hjust = 1, vjust = 1))

combined2 <- p3 + p4 + plot_layout(ncol = 2)
combined2 

GEO Summary

Landing Counts and Landed Weight for Domestic and International Flights

airlinedf <- airlinedf %>%
    mutate(geo_summary = factor(geo_summary, levels = c("Domestic", "International")))

geosummarycolours <- c("salmon4", "wheat3")

p5  <- ggplot(airlinedf, aes(x = geo_summary, y = landing_count, fill = geo_summary)) +
        geom_bar(stat = "identity") +
        scale_fill_manual(values = geosummarycolours) + 
        labs(x = "GEO Summary", y = "Landing Count", fill = "GEO Summary",
             title = "Bar Plot of Total Landing Count for Domestic & International Flights") +
        theme(plot.background = element_rect(fill = "grey90"),
              panel.background = element_rect(fill = "seashell2"),
              panel.grid = element_line(colour = "grey90"),
              legend.background = element_rect(fill = "grey90"),
              text = element_text(size = 10))

p6 <- ggplot(airlinedf, aes(x = geo_summary, y = total_landed_weight, fill = geo_summary)) +
        geom_bar(stat = "identity") +
        scale_fill_manual(values = geosummarycolours) + 
        labs(x = "GEO Summary", y = "Total Landed Weight", fill = "GEO Summary",
             title = "Bar Plot of Total Landed Weight for Domestic & International Flights") +
        theme(plot.background = element_rect(fill = "grey90"),
              panel.background = element_rect(fill = "seashell2"),
              panel.grid = element_line(colour = "grey90"),
              legend.background = element_rect(fill = "grey90"),
              text = element_text(size = 10))

combined3 <- p5 + p6 + plot_layout(ncol = 2)
combined3

Geographical Regions, Landing Aircraft Types & Aircraft Manufacturers Across Domestic and International Flights

regioncolours <- c("burlywood4", "lemonchiffon2", "lightsteelblue4", "lightcoral", "aquamarine4",
                   "antiquewhite3", "lightblue3", "tan", "honeydew", "indianred4")

p7<- ggplot(airlinedf, aes(x = geo_summary, fill = geo_region)) + 
        geom_bar(colour = "grey35") +
        scale_fill_manual(values = regioncolours) + 
        labs(x = "GEO Summary", y = "Count", fill = "Region",
             title = "Distribution of Geographical Regions across Domestic & International Flights") +
        theme(plot.background = element_rect(fill = "grey90"),
              panel.background = element_rect(fill = "seashell2"),
              panel.grid = element_line(colour = "grey90"),
              legend.background = element_rect(fill = "grey90"),
              text = element_text(size = 9)) 

landingaircrafttypecolours <- c("wheat2", "salmon4", "paleturquoise4")

p8 <- ggplot(airlinedf, aes(x = geo_summary, fill = landing_aircraft_type)) + 
        geom_bar(colour = "grey35") +
        scale_fill_manual(values = landingaircrafttypecolours) + 
        labs(x = "GEO Summary", y = "Count", fill = "Landing Aircraft Type",
             title = "Distribution of Landing Aircraft Type across Domestic & International Flights") +
        theme(plot.background = element_rect(fill = "grey90"),
              panel.background = element_rect(fill = "seashell2"),
              panel.grid = element_line(colour = "grey90"),
              legend.background = element_rect(fill = "grey90"),
              text = element_text(size = 9)) 

aircraftmanufacturercolours <- c("tan4", "wheat2", "cadetblue4", "indianred4", "paleturquoise4", 
                                 "salmon4", "lightblue3", "antiquewhite3", "lightcyan3", "bisque",
                                 "burlywood4", "lemonchiffon2", "honeydew", "lightcoral", "honeydew4")

p9 <- ggplot(airlinedf, aes(x = geo_summary, fill = aircraft_manufacturer)) + 
        geom_bar(colour = "grey35", linewidth = 0.5) +
        scale_fill_manual(values = aircraftmanufacturercolours) +
        labs(x = "GEO Summary", y = "Count", fill = "Aircraft Manufacturer",
             title = "Distribution of Aircraft Manufacturer across Domestic & International Flights") +
        theme(plot.background = element_rect(fill = "grey90"),
              panel.background = element_rect(fill = "seashell2"),
              panel.grid = element_line(colour = "grey90"),
              legend.background = element_rect(fill = "grey90"),
              text = element_text(size = 9)) +
        guides(fill = guide_legend(ncol = 2))

combined4 <- p7 + p8 + p9 +plot_layout(ncol = 2)
combined4

Region

Total Landing Count and Landed Weight of Each Region

regiondf1 <- airlinedf %>%  
    group_by(geo_region) %>% 
    summarise(landing_count = sum(landing_count), total_landed_weight = sum(total_landed_weight)) 

p10 <- ggplot(regiondf1, aes(x = geo_region, y = landing_count, fill = geo_region)) +
        geom_bar(stat = "identity", color = "grey35") +
        scale_fill_manual(values = regioncolours) +
        labs(x = "Regions", y = "Landing Count", fill = "Regions",
             title = "Bar Plot of Total Landing Counts of Each Region") +
        theme(plot.background = element_rect(fill = "grey90"),
              panel.background = element_rect(fill = "seashell2"),
              panel.grid = element_line(colour = "grey90"),
              legend.background = element_rect(fill = "grey90"),
              axis.text.x = element_text(angle = 45, hjust = 1, vjust = 1))

p11 <- ggplot(regiondf1, aes(x = geo_region, y = total_landed_weight, fill = geo_region)) +
        geom_bar(stat = "identity", color = "grey35") +
        scale_fill_manual(values = regioncolours) +
        labs(x = "Region", y = "Total Landed Weight", fill = "Region",
             title = "Bar Plot of Total Landed Weight of Each Region") +
        theme(plot.background = element_rect(fill = "grey90"),
              panel.background = element_rect(fill = "seashell2"),
              panel.grid = element_line(colour = "grey90"),
              legend.background = element_rect(fill = "grey90"),
              axis.text.x = element_text(angle = 45, hjust = 1, vjust = 1))

combined5 <- p10 + p11 + plot_layout(ncol = 2)
combined5

Number of Distinct Operating Airlines for Each Region

region_O_airline <- airlinedf %>% 
    group_by(geo_region) %>% 
    summarise(unique_operating_airline_count = n_distinct(operating_airline))
region_O_airline 
## # A tibble: 10 × 2
##    geo_region          unique_operating_airline_count
##    <chr>                                        <int>
##  1 Asia                                            34
##  2 Australia / Oceania                              6
##  3 Canada                                          13
##  4 Caribbean                                        3
##  5 Central America                                  4
##  6 Europe                                          30
##  7 Mexico                                          12
##  8 Middle East                                      3
##  9 South America                                    5
## 10 US                                              53

Number of Distinct Number of Published Airlines for Each Region

region_P_airline <- airlinedf %>% 
    group_by(geo_region) %>% 
    summarise(unique_published_airline_count = n_distinct(published_airline))
region_P_airline
## # A tibble: 10 × 2
##    geo_region          unique_published_airline_count
##    <chr>                                        <int>
##  1 Asia                                            34
##  2 Australia / Oceania                              6
##  3 Canada                                          10
##  4 Caribbean                                        3
##  5 Central America                                  4
##  6 Europe                                          30
##  7 Mexico                                          12
##  8 Middle East                                      3
##  9 South America                                    5
## 10 US                                              45

Landing Count of Different Aircraft Body Types Across Each Region

region_aircraft_type_landing_count <- airlinedf %>% 
    group_by(geo_region, aircraft_body_type) %>% 
    summarise(total_landing_count = sum(landing_count)) %>% 
    ungroup()

region_aircraft_type_landing_count_wide <- region_aircraft_type_landing_count %>% 
    pivot_wider(names_from = geo_region,
                values_from = total_landing_count,
                values_fill = list(total_landing_count = 0))
region_aircraft_type_landing_count_wide
## # A tibble: 4 × 11
##   aircraft_body_type  Asia `Australia / Oceania` Canada Caribbean
##   <chr>              <int>                 <int>  <int>     <int>
## 1 Narrow Body           18                     0  40845         0
## 2 Wide Body          47549                  4116   1523         3
## 3 Regional Jet           0                     0  28845         0
## 4 Turbo Prop             0                     0      0         0
## # ℹ 6 more variables: `Central America` <int>, Europe <int>, Mexico <int>,
## #   `Middle East` <int>, `South America` <int>, US <int>

Total Landed Weight of Different Aircraft Body Types Across Each Region

region_aircraft_type_landing_weight <- airlinedf %>% 
    group_by(geo_region, aircraft_body_type) %>% 
    summarise(total_landed_weight = sum(total_landed_weight)) %>% 
    ungroup()

region_aircraft_type_landing_weight_wide <- region_aircraft_type_landing_weight %>% 
    pivot_wider(names_from = geo_region,
                values_from = total_landed_weight,
                values_fill = list(total_landed_weight = 0))
region_aircraft_type_landing_weight_wide
## # A tibble: 4 × 11
##   aircraft_body_type        Asia `Australia / Oceania`     Canada Caribbean
##   <chr>                    <dbl>                 <dbl>      <dbl>     <dbl>
## 1 Narrow Body            2831400                     0 5723798718         0
## 2 Wide Body          26561953943            2335740691  536214638   1508878
## 3 Regional Jet                 0                     0 2092961976         0
## 4 Turbo Prop                   0                     0          0         0
## # ℹ 6 more variables: `Central America` <dbl>, Europe <dbl>, Mexico <dbl>,
## #   `Middle East` <dbl>, `South America` <dbl>, US <dbl>

Landing Count and Total Landed Weight of Aircraft Body Types acorss Each Region

aircraftbodytypecolours <- c("bisque3", "indianred4", "honeydew", "lightblue4")

p12 <- ggplot(region_aircraft_type_landing_count, aes(x = geo_region, y = total_landing_count, fill = aircraft_body_type)) +
        geom_bar(stat = "identity", colour = "grey35") +
        scale_fill_manual(values = aircraftbodytypecolours) +
        labs(x = "Region", y = "Landing Count", fill = "Aircraft Body Type",
             title = "Bar Plot of Aircraft Body Type across of Each Region (Landing Count)") +
        theme(plot.background = element_rect(fill = "grey90"),
              panel.background = element_rect(fill = "seashell2"),
              panel.grid = element_line(colour = "grey90"),
              legend.background = element_rect(fill = "grey90"),
              axis.text.x = element_text(angle = 45, hjust = 1, vjust = 1),
              text = element_text(size = 9))

p13 <- ggplot(region_aircraft_type_landing_weight, aes(x = geo_region, y = total_landed_weight, fill = aircraft_body_type)) +
        geom_bar(stat = "identity", colour = "grey35") +
        scale_fill_manual(values = aircraftbodytypecolours) +
        labs(x = "Regions", y = "Total Landed Weight", fill = "Aircraft Body Type",
             title = "Bar Plot of Aircraft Body Type across of Each Region (Total Landed Weight)") +
        theme(plot.background = element_rect(fill = "grey90"),
              panel.background = element_rect(fill = "seashell2"),
              panel.grid = element_line(colour = "grey90"),
              legend.background = element_rect(fill = "grey90"),
              axis.text.x = element_text(angle = 45, hjust = 1, vjust = 1),
              text = element_text(size = 9))

combined6 <- p12 + p13 + plot_layout(ncol = 2)
combined6

Landing Aircraft Type

Landing Count and Total Landed Weight across Each Landing Aircraft Type

landingaircrafttypedf <- airlinedf %>%  
    group_by(landing_aircraft_type) %>%  
    summarise(landing_count = sum(landing_count), total_landed_weight = sum(total_landed_weight))

p14 <- ggplot(landingaircrafttypedf, aes(x = landing_aircraft_type, y = landing_count, fill = landing_aircraft_type)) +
        geom_bar(stat = "identity", colour = "grey35") +
        scale_fill_manual(values = aircraftbodytypecolours) + 
        labs(x = "Aircraft Body Types", y = "Landing Count", fill = "Aircraft Body Types",
             title = "Bar Plot of Landing Count across each Landing Aircraft Type") +
        theme(plot.background = element_rect(fill = "grey90"),
              panel.background = element_rect(fill = "seashell2"),
              panel.grid = element_line(colour = "grey90"),
              legend.background = element_rect(fill = "grey90"),
              text = element_text(size = 10))

p15 <- ggplot(landingaircrafttypedf, aes(x = landing_aircraft_type, y = total_landed_weight, fill = landing_aircraft_type)) +
        geom_bar(stat = "identity", colour = "grey35") +
        scale_fill_manual(values = aircraftbodytypecolours) + 
        labs(x = "Aircraft Body Types", y = "Total Landed Weight", fill = "Aircraft Body Types",
             title = "Bar Plot of Total Landed Weight across each Landing Aircraft Type") +
        theme(plot.background = element_rect(fill = "grey90"),
              panel.background = element_rect(fill = "seashell2"),
              panel.grid = element_line(colour = "grey90"),
              legend.background = element_rect(fill = "grey90"),
              text = element_text(size = 10))

combined7 <- p14 + p15 + plot_layout(ncol = 2)
combined7

Aircraft Body Types and Aircraft Manufacturers acorss each Landing Aircraft Type

p16<- ggplot(airlinedf, aes(x = landing_aircraft_type, fill = aircraft_body_type)) +
        geom_bar(colour = "grey35") +
        scale_fill_manual(values = aircraftbodytypecolours) +
        labs(x = "Landing Aircraft Types", y = "Count", fill = "Aircraft Body Types",
             title = "Bar Plot of Aircraft Body Types across each Landing Aircraft Type") +
        theme(plot.background = element_rect(fill = "grey90"),
              panel.background = element_rect(fill = "seashell2"),
              panel.grid = element_line(colour = "grey90"),
              legend.background = element_rect(fill = "grey90"),
              text = element_text(size = 10))

p17 <- ggplot(airlinedf, aes(x = landing_aircraft_type, fill = aircraft_manufacturer)) +
        geom_bar(colour = "grey35") +
        scale_fill_manual(values = aircraftmanufacturercolours) +
        labs(x = "Landing Aircraft Types", y = "Count", fill = "Aircraft Manufacturer",
             title = "Bar Plot of Aircraft Manufacturers across each Landing Aircraft Type") +
        theme(plot.background = element_rect(fill = "grey90"),
              panel.background = element_rect(fill = "seashell2"),
              panel.grid = element_line(colour = "grey90"),
              legend.background = element_rect(fill = "grey90"),
              text = element_text(size = 10))

combined8 <- p16 + p17 + plot_layout(ncol = 2)
combined8

Box Plots

Top 10 Highest Landing Count of Operating and Published Airlines

top10_O_airlines_boxplotdf1 <- airlinedf %>%  
    select(operating_airline, published_airline, landing_count) %>% 
    filter(operating_airline %in% top10_O_airlines$operating_airline)

top10_P_airlines_boxplotdf1 <- airlinedf %>%  
    select(published_airline, landing_count) %>% 
    filter(published_airline %in% top10_P_airlines$published_airline)

p18 <- ggplot(top10_O_airlines_boxplotdf1, aes(x = operating_airline, y = landing_count, fill = operating_airline)) + 
        geom_boxplot() +
        scale_fill_manual(values = OAcolours) +
        geom_point() +
        labs(x = "Operating Airlines", y = "Landing Count", fill = "Operating Airlines",
             title = "Box Plots of Top 10 Highest Landing Count Operating Airlines") +
        theme(plot.background = element_rect(fill = "grey90"),
              panel.background = element_rect(fill = "seashell2"),
              panel.grid = element_line(colour = "grey90"),
              legend.background = element_rect(fill = "grey90"),
              axis.text.x = element_text(angle = 45, hjust = 1, vjust = 1),
              text = element_text(size = 10))

p19 <- ggplot(top10_P_airlines_boxplotdf1, aes(x = published_airline, y = landing_count, fill = published_airline)) + 
        geom_boxplot() +
        geom_point() +
        scale_fill_manual(values = PAcolours) + 
        labs(x = "Published Airlines", y = "Landing Count", fill = "Published Airlines",
             title = "Box Plots of Top 10 Highest Total Landing Count Published Airlines") +
        theme(plot.background = element_rect(fill = "grey90"),
              panel.background = element_rect(fill = "seashell2"),
              panel.grid = element_line(colour = "grey90"),
              legend.background = element_rect(fill = "grey90"),
              axis.text.x = element_text(angle = 45, hjust = 1, vjust = 1),
              text = element_text(size = 10))

combined9 <- p18 + p19 + plot_layout(ncol = 2)
combined9

Top 10 Highest Total Landed Weight of Operating and Published Airlines

top10_O_airlines_boxplotdf2 <- airlinedf %>%  
    select(operating_airline, published_airline, total_landed_weight) %>% 
    filter(operating_airline %in% top10_O_airlines2$operating_airline)

top10_P_airlines_boxplotdf2 <- airlinedf %>%  
    select(published_airline, total_landed_weight) %>% 
    filter(published_airline %in% top10_P_airlines2$published_airline)

p20 <- ggplot(top10_O_airlines_boxplotdf2, aes(x = operating_airline, y = total_landed_weight, fill = operating_airline)) + 
        geom_boxplot() +
        geom_point() +
        scale_fill_manual(values = OAcolours) + 
        labs(x = "Operating Airlines", y = "Total Landed Weight", fill = "Operating Airlines",
             title = "Box Plots of Top 10 Highest Total Landed Weight Operating Airlines") +
        theme(plot.background = element_rect(fill = "grey90"),
              panel.background = element_rect(fill = "seashell2"),
              panel.grid = element_line(colour = "grey90"),
              legend.background = element_rect(fill = "grey90"),
              axis.text.x = element_text(angle = 45, hjust = 1, vjust = 1),
              text = element_text(size = 10))

p21 <- ggplot(top10_P_airlines_boxplotdf2, aes(x = published_airline, y = total_landed_weight, fill = published_airline)) + 
        geom_boxplot() +
        geom_point() +
        scale_fill_manual(values = PAcolours) +
        labs(x = "Published Airlines", y = "Total Landed Weight", fill = "Published Airlines",
             title = "Box Plots of Top 10 Highest Total Landed Weight Published Airlines") +
        theme(plot.background = element_rect(fill = "grey90"),
              panel.background = element_rect(fill = "seashell2"),
              panel.grid = element_line(colour = "grey90"),
              legend.background = element_rect(fill = "grey90"),
              axis.text.x = element_text(angle = 45, hjust = 1, vjust = 1),
              text = element_text(size = 10))

combined10 <- p20 + p21 + plot_layout(ncol = 2)
combined10

Landing Count and Total Landed Weight for Domestic and International Flights

p22 <- ggplot(airlinedf, aes(x = geo_summary, y = landing_count, fill = geo_summary)) +
        geom_boxplot() +
        scale_fill_manual(values = geosummarycolours) +
        geom_point() +
        labs(x = "GEO Summary", y = "Landing Count", fill = "GEO Summary",
             title = "Box Plots of Landing Counts for Domestic & International Flights") +
        theme(plot.background = element_rect(fill = "grey90"),
              panel.background = element_rect(fill = "seashell2"),
              panel.grid = element_line(colour = "grey90"),
              legend.background = element_rect(fill = "grey90"),
              text = element_text(size = 10))

p23 <- ggplot(airlinedf, aes(x = geo_summary, y = total_landed_weight, fill = geo_summary)) +
        geom_boxplot() +
        scale_fill_manual(values = geosummarycolours) +
        geom_point() +
        labs(x = "GEO Summary", y = "Total Landed Weight", fill = "GEO Summary",
             title = "Box Plots of Total Landed Weight for Domestic & International Flights") +
        theme(plot.background = element_rect(fill = "grey90"),
              panel.background = element_rect(fill = "seashell2"),
              panel.grid = element_line(colour = "grey90"),
              legend.background = element_rect(fill = "grey90"),
              text = element_text(size = 10))

combined11 <- p22 + p23 + plot_layout(ncol = 2)
combined11

Landing Count and Total Landed Weight across Each Region

p24 <- ggplot(airlinedf, aes(x = geo_region, y = landing_count, fill = geo_region)) +
        geom_boxplot() +
        scale_fill_manual(values = regioncolours) +
        geom_point() +
        labs(x = "Regions", y = "Landing Count", fill = "Regions",
             title = "Box Plots of Landing Counts across Regions") +
            theme(plot.background = element_rect(fill = "grey90"),
                  panel.background = element_rect(fill = "seashell2"),
                  panel.grid = element_line(colour = "grey90"),
                  legend.background = element_rect(fill = "grey90"),
                  axis.text.x = element_text(angle = 45, hjust = 1, vjust = 1),
                  text = element_text(size = 10))

p25 <- ggplot(airlinedf, aes(x = geo_region, y = total_landed_weight, fill = geo_region)) +
        geom_boxplot() +
        scale_fill_manual(values = regioncolours) +
        geom_point() +
        labs(x = "Regions", y = "Total Landed Weight", fill = "Regions",
             title = "Box Plots of Total Landed Weight across Regions") +
        theme(plot.background = element_rect(fill = "grey90"),
              panel.background = element_rect(fill = "seashell2"),
              panel.grid = element_line(colour = "grey90"),
              legend.background = element_rect(fill = "grey90"),
              axis.text.x = element_text(angle = 45, hjust = 1, vjust = 1),
              text = element_text(size = 10))

combined12 <- p24 + p25 + plot_layout(ncol = 2)
combined12

Landing Count and Total Landed Weight across Each Landing Aircraft Type

p26 <- ggplot(airlinedf, aes(x = landing_aircraft_type, y = landing_count, fill = landing_aircraft_type)) +
        geom_boxplot() +
        scale_fill_manual(values = landingaircrafttypecolours) + 
        geom_point() +
        labs(x = "Landing Aircraft Types", y = "Landing Count", fill = "Landing Aircraft Types",
             title = "Box Plots of Landing Counts across Landing Aircraft Types") +
        theme(plot.background = element_rect(fill = "grey90"),
              panel.background = element_rect(fill = "seashell2"),
              panel.grid = element_line(colour = "grey90"),
              legend.background = element_rect(fill = "grey90"),
                text = element_text(size = 10))

p27 <- ggplot(airlinedf, aes(x = landing_aircraft_type, y = total_landed_weight, fill = landing_aircraft_type)) +
        geom_boxplot() +
        scale_fill_manual(values = landingaircrafttypecolours) +
        geom_point() +
        labs(x = "Landing Aircraft Types", y = "Total Landed Weight", fill = "Landing Aircraft Types",
             title = "Box Plots of Total Landed Weight across Landing Aircraft Types") +
        theme(plot.background = element_rect(fill = "grey90"),
              panel.background = element_rect(fill = "seashell2"),
              panel.grid = element_line(colour = "grey90"),
              legend.background = element_rect(fill = "grey90"), 
                text = element_text(size = 10))

combined13 <- p26 + p27 + plot_layout(ncol = 2)
combined13

Landing Count and Total Landed Weight across Each Aircraft Body Type

p28 <- ggplot(airlinedf, aes(x = aircraft_body_type, y = landing_count, fill = aircraft_body_type)) +
        geom_boxplot() +
        scale_fill_manual(values = aircraftbodytypecolours) + 
        geom_point() +
        labs(x = "Aircraft Body Types", y = "Landing Count", fill = "Aircraft Body Types",
             title = "Box Plots of Landing Counts across Aircraft Body Types") +
        theme(plot.background = element_rect(fill = "grey90"),
              panel.background = element_rect(fill = "seashell2"),
              panel.grid = element_line(colour = "grey90"),
              legend.background = element_rect(fill = "grey90"), 
              text = element_text(size = 10))

p29 <- ggplot(airlinedf, aes(x = aircraft_body_type, y = total_landed_weight, fill = aircraft_body_type)) +
        geom_boxplot() +
        scale_fill_manual(values = aircraftbodytypecolours) +
        geom_point() +
        labs(x = "Aircraft Body Types", y = "Total Landed Weight", fill = "Aircraft Body Types",
             title = "Box Plots of Total Landed Weight across Aircraft Body Types") +
            theme(plot.background = element_rect(fill = "grey90"),
                  panel.background = element_rect(fill = "seashell2"),
                  panel.grid = element_line(colour = "grey90"),
                  legend.background = element_rect(fill = "grey90"), 
                  text = element_text(size = 10))

combined14 <- p28 + p29 + plot_layout(ncol = 2)
combined14

Landing Count and Total Landed Weight across Each Aircraft Manufacturer

p30 <- ggplot(airlinedf, aes(x = aircraft_manufacturer, y = landing_count, fill = aircraft_manufacturer)) +
        geom_boxplot() +
        scale_fill_manual(values = aircraftmanufacturercolours) + 
        geom_point() +
        labs(x = "Aircraft Manufacturers", y = "Landing Count", fill = "Aircraft Manufacturers",
             title = "Box Plots of Landing Counts across Aircraft Manufacturers") +
        theme(plot.background = element_rect(fill = "grey90"),
              panel.background = element_rect(fill = "seashell2"),
              panel.grid = element_line(colour = "grey90"),
              legend.background = element_rect(fill = "grey90"),
              axis.text.x = element_text(angle = 45, hjust = 1, vjust = 1), 
              text = element_text(size = 10))

p31 <- ggplot(airlinedf, aes(x = aircraft_manufacturer, y = total_landed_weight, fill = aircraft_manufacturer)) +
        geom_boxplot() +
        scale_fill_manual(values = aircraftmanufacturercolours) + 
        geom_point() +
        labs(x = "Aircraft Manufacturers", y = "Total Landed Weight", fill = "Aircraft Manufacturers",
             title = "Box Plots of Total Landed Weight across Aircraft Manufacturers") +
        theme(plot.background = element_rect(fill = "grey90"),
              panel.background = element_rect(fill = "seashell2"),
              panel.grid = element_line(colour = "grey90"),
              legend.background = element_rect(fill = "grey90"),
              axis.text.x = element_text(angle = 45, hjust = 1, vjust = 1), 
              text = element_text(size = 10))

combined15 <- p30 + p31 + plot_layout(ncol = 2)
combined15

Conclusion

In conclusion, our analysis of the airlines dataset has yielded valuable insights into various airlines and their fleets. It has become evident that examining both landing counts and landed weights is crucial, as a higher landing count does not necessarily correlate with a higher landed weight, as demonstrated in our findings. This underscores the importance of comprehensive data analysis in understanding the dynamics of airline operations and fleet management.