Introduction

This report presents initial results from a Media Cloud analysis comparing Boeing and Airbus news coverage between September 2021 and November 2026. The report includes a coverage volume visualization along with unigram and n-gram analyses of news headlines.

 

The chart below compares weekly media coverage volume for Boeing and Airbus between September 2021 and November 2026.

The following unigram charts display the most common one-word terms appearing in both Boeing and Airbus related news headlines.

The following n-gram charts display the most common two-word phrases appearingn both Boeing and Airbus related news headlines.

Code

############################################################
# Boeing v Airbus Coverage Volume
#
# STEP 1: Install and Load Packages
############################################################

if (!require("tidyverse")) install.packages("tidyverse")
if (!require("lubridate")) install.packages("lubridate")
if (!require("plotly")) install.packages("plotly")

library(tidyverse)
library(lubridate)
library(plotly)

############################################################
# STEP 2: Prepare Boeing and Airbus Story Count Data
############################################################

boeing_plot <- boeing_counts %>%
  select(date, count) %>%
  mutate(company = "Boeing")

airbus_plot <- airbus_counts %>%
  select(date, count) %>%
  mutate(company = "Airbus")

coverage_data <- bind_rows(
  boeing_plot,
  airbus_plot
)

############################################################
# STEP 3: Calculate Weekly Story Counts
############################################################

weekly_counts <-
  coverage_data %>%
  mutate(
    week = floor_date(date, unit = "week")
  ) %>%
  group_by(company, week) %>%
  summarise(
    stories = sum(count),
    .groups = "drop"
  )

############################################################
# STEP 4: Examine Weekly Data
############################################################

head(weekly_counts)

glimpse(weekly_counts)

############################################################
# STEP 5: Create Interactive Plotly Line Graph
############################################################

weekly_plotly <- plot_ly(
  data = weekly_counts,
  x = ~week,
  y = ~stories,
  color = ~company,
  colors = "Set1",
  type = "scatter",
  mode = "lines+markers",
  marker = list(size = 5),
  line = list(width = 2),
  customdata = ~format(stories, big.mark = ","),
  hovertemplate = paste(
    "<b>Company:</b> %{fullData.name}<br>",
    "<b>Week:</b> %{x}<br>",
    "<b>Stories:</b> %{customdata}<extra></extra>"
  )
)

weekly_plotly <- plotly::layout(
  weekly_plotly,
  title = "Weekly Media Coverage Volume",
  xaxis = list(title = "Week"),
  yaxis = list(title = "Number of Stories"),
  legend = list(
    title = list(
      text = "Company"
    )
  ),
  hovermode = "x unified"
)

weekly_plotly
############################################################
# Boeing Unigram Chart
#
# Step 1: Install and Load Packages ----
############################################################
library(tidyverse)
library(tidytext)

############################################################
# Step 2: Create Boeing Headline Unigrams ----
############################################################

unigrams <- boeing_headlines %>%
  unnest_tokens(
    word,
    title
  )

############################################################
# Step 3: Remove Stop Words ----
############################################################

data(stop_words)

unigrams_clean <- unigrams %>%
  anti_join(
    stop_words,
    by = "word"
  )

############################################################
# Step 4: Remove Web and Media Artifacts ----
############################################################

media_noise <- c(
  "https",
  "http",
  "www",
  "com",
  "amp",
  "rt",
  "co",
  "tco"
)

unigrams_clean <- unigrams_clean %>%
  filter(
    !word %in% media_noise
  )

############################################################
# Step 5: Examine Most Common Words ----
############################################################

unigram_counts <- unigrams_clean %>%
  count(
    word,
    sort = TRUE
  )

head(unigram_counts, 30)

############################################################
# Step 6: Remove Custom Words ----
############################################################

custom_stop_words <- tibble(
  word = c(
    "boeing",
    "airbus",
    "says",
    "said",
    "news",
    "box",
    "new",
    "ap",
    "us",
    "u.s"
  )
)

unigrams_final <- unigrams_clean %>%
  anti_join(
    custom_stop_words,
    by = "word"
  )

############################################################
# Step 7: Count Final Unigrams ----
############################################################

unigram_counts_final <- unigrams_final %>%
  count(
    word,
    sort = TRUE
  )

############################################################
# Step 8: Select Top 25 Words ----
############################################################

top_words <- unigram_counts_final %>%
  slice_max(
    n,
    n = 10
  )

############################################################
# Step 9: Create Graph ----
############################################################

boeing_unigram_chart <- ggplot(
  top_words,
  aes(
    x = reorder(word, n),
    y = n
  )
) +
  geom_col(fill = "steelblue") +
  geom_text(
    aes(label = n),
    hjust = -0.1,
    size = 3
  ) +
  coord_flip() +
  scale_y_continuous(
    expand = expansion(mult = c(0, .10))
  ) +
  labs(
    title = "10 Most Common Unigrams in Boeing News Headlines",
    x = "Word",
    y = "Frequency"
  ) +
  theme_minimal()

boeing_unigram_chart
############################################################
# Airbus Unigram Chart
#
# Step 1: Install and Load Packages ----
############################################################

library(tidyverse)
library(tidytext)

############################################################
# Step 2: Create Airbus Headline Unigrams ----
############################################################

unigrams <- airbus_headlines %>%
  unnest_tokens(
    word,
    title
  )

############################################################
# Step 3: Remove Stop Words ----
############################################################

data(stop_words)

unigrams_clean <- unigrams %>%
  anti_join(
    stop_words,
    by = "word"
  )

############################################################
# Step 4: Remove Web and Media Artifacts ----
############################################################

media_noise <- c(
  "https",
  "http",
  "www",
  "com",
  "amp",
  "rt",
  "co",
  "tco"
)

unigrams_clean <- unigrams_clean %>%
  filter(
    !word %in% media_noise
  )

############################################################
# Step 5: Examine Most Common Words ----
############################################################

unigram_counts <- unigrams_clean %>%
  count(
    word,
    sort = TRUE
  )

head(unigram_counts, 30)

############################################################
# Step 6: Remove Custom Words ----
############################################################

custom_stop_words <- tibble(
  word = c(
    "boeing",
    "airbus",
    "says",
    "said",
    "de",
    "news",
    "box",
    "new",
    "ap",
    "us",
    "u.s"
  )
)

unigrams_final <- unigrams_clean %>%
  anti_join(
    custom_stop_words,
    by = "word"
  )

############################################################
# Step 7: Count Final Unigrams ----
############################################################

unigram_counts_final <- unigrams_final %>%
  count(
    word,
    sort = TRUE
  )

############################################################
# Step 8: Select Top 10 Words ----
############################################################

top_words <- unigram_counts_final %>%
  slice_max(
    n,
    n = 10
  )

############################################################
# Step 9: Create Graph ----
############################################################

airbus_unigram_chart <- ggplot(
  top_words,
  aes(
    x = reorder(word, n),
    y = n
  )
) +
  geom_col(fill = "firebrick") +
  geom_text(
    aes(label = n),
    hjust = -0.1,
    size = 3
  ) +
  coord_flip() +
  scale_y_continuous(
    expand = expansion(mult = c(0, .10))
  ) +
  labs(
    title = "10 Most Common Unigrams in Airbus News Headlines",
    x = "Word",
    y = "Frequency"
  ) +
  theme_minimal()

airbus_unigram_chart
# Boeing Headline N-Gram Analysis

### Step 1: Install and Load Packages ### ----


library(tidyverse)
library(tidytext)


### Step 2: Choose Phrase Length ### ----

n_size <- 2

### Step 3: Load Stop Words ### ----

data(stop_words)

### Step 4: Create N-Grams ### ----

ngrams <- boeing_headlines %>%
  unnest_tokens(
    ngram,
    title,
    token = "ngrams",
    n = n_size
  )


### Step 5: Calculate Stop Word Percentage ### ----


max_stopword_pct <- 33

ngrams_filtered <- ngrams %>%
  mutate(
    words = str_split(
      ngram,
      " "
    )
  ) %>%
  rowwise() %>%
  mutate(
    total_words = length(words),
    stop_words_in_phrase =
      sum(words %in% stop_words$word),
    stop_word_pct =
      stop_words_in_phrase /
      total_words * 100
  ) %>%
  ungroup() %>%
  filter(
    stop_word_pct < max_stopword_pct
  )

### Step 6: Count Phrases ### ----


ngram_counts <- ngrams_filtered %>%
  count(
    ngram,
    sort = TRUE
  )

### Step 7: Define Custom Phrases ### ----


custom_phrases <- tibble(
  ngram = c(
    "ap top"
  )
)

### Step 8: Remove Custom Phrases ### ----


ngram_counts_final <- ngram_counts %>%
  anti_join(
    custom_phrases,
    by = "ngram"
  )


### Step 9: Select Top Phrases ### ----


top_phrases <- ngram_counts_final %>%
  slice_max(
    n,
    n = 10
  )

### Step 10: Create Graph ### ----


boeing_ngram_chart <- ggplot(
  top_phrases,
  aes(
    x = reorder(ngram, n),
    y = n
  )
) +
  geom_col(fill = "steelblue") +
  geom_text(
    aes(label = n),
    hjust = -0.1,
    size = 3
  ) +
  coord_flip() +
  scale_y_continuous(
    expand = expansion(mult = c(0, .10))
  ) +
  labs(
    title = paste(
      "Top 10-",
      n_size,
      "Word Phrases in Boeing News Headlines"
    ),
    x = "Phrase",
    y = "Frequency"
  ) +
  theme_minimal()

boeing_ngram_chart
############################################################
# Airbus Headline N-Gram Analysis
#
# Step 1: Install and Load Packages ----
############################################################

library(tidyverse)
library(tidytext)

############################################################
# Step 2: Choose Phrase Length ----
############################################################

n_size <- 2

############################################################
# Step 3: Load Stop Words ----
############################################################

data(stop_words)

############################################################
# Step 4: Create N-Grams ----
############################################################

ngrams <- airbus_headlines %>%
  unnest_tokens(
    ngram,
    title,
    token = "ngrams",
    n = n_size
  )

############################################################
# Step 5: Calculate Stop Word Percentage ----
############################################################

max_stopword_pct <- 33

ngrams_filtered <- ngrams %>%
  mutate(
    words = str_split(
      ngram,
      " "
    )
  ) %>%
  rowwise() %>%
  mutate(
    total_words = length(words),
    stop_words_in_phrase =
      sum(words %in% stop_words$word),
    stop_word_pct =
      stop_words_in_phrase /
      total_words * 100
  ) %>%
  ungroup() %>%
  filter(
    stop_word_pct < max_stopword_pct
  )

############################################################
# Step 6: Count Phrases ----
############################################################

ngram_counts <- ngrams_filtered %>%
  count(
    ngram,
    sort = TRUE
  )

############################################################
# Step 7: Examine Most Common Phrases ----
############################################################

head(
  ngram_counts,
  30
)

############################################################
# Step 8: Define Custom Phrases ----
############################################################

custom_phrases <- tibble(
  ngram = c(
    "ap top"
  )
)

############################################################
# Step 9: Remove Custom Phrases ----
############################################################

ngram_counts_final <- ngram_counts %>%
  anti_join(
    custom_phrases,
    by = "ngram"
  )

############################################################
# Step 10: Examine Final Phrase Counts ----
############################################################

head(
  ngram_counts_final,
  30
)

############################################################
# Step 11: Select Top Phrases ----
############################################################

top_phrases <- ngram_counts_final %>%
  slice_max(
    n,
    n = 10
  )

############################################################
# Step 12: Create Graph ----
############################################################

airbus_ngram_chart <- ggplot(
  top_phrases,
  aes(
    x = reorder(ngram, n),
    y = n
  )
) +
  geom_col(
    fill = "firebrick"
  ) +
  geom_text(
    aes(label = n),
    hjust = -0.1,
    size = 3
  ) +
  coord_flip() +
  scale_y_continuous(
    expand = expansion(mult = c(0, .10))
  ) +
  labs(
    title = paste(
      "Top 10-",
      n_size,
      "Word Phrases in Airbus News Headlines"
    ),
    x = "Phrase",
    y = "Frequency"
  ) +
  theme_minimal()

############################################################
# Step 13: Display Chart ----
############################################################

airbus_ngram_chart