Below is a graph of the 25 most common unigrams among a data set of over 54,000 news stories from MediaCloud.org’s “United States - National” collection that mentioned “Donald Trump” and were published between August 3rd, 2026, and October 4th, 2026. Including standard stop words and social media artifacts, I omitted words that are most likely dominated by news coverage, like “breaking,” “update,” and “live,” and words referencing Donald Trump, like his proper name and title. These words appear very commonly in news stories about Trump, thus appearing more often than the presented unigrams. They also do not help identify significant topics and themes in these headlines.
The four most common words in the data set, “iran,” “house,” “war,” and “court,” were each mentioned over 2,000 times. The next three highest, “white,” “gop,” and “ai,” were mentioned just over 1900 times. Even though the next election cycle looms within the coming months, the Iran War still dominates headlines. This direct foreign issue takes precedence over various domestic issues and topics, such as AI, ICE, and midterm elections, as well as other foreign issues, such as our relationships with other countries.
It is important to note that while these words appear in the given headlines often, they can appear in different contexts or frames, as with framing theory, depending on the given cues. A headline could frame a story or topic in various ways, like approval or disapproval, or even just informative. Given how often these words appear, these topics are more likely to be on the public’s conscience. People are much more attentive to these stories if they are relevant to them, as shown in agenda-setting theory.
Below is the code used to conduct the analysis.
############################################################
# Unigram Analysis of Trump Story Headlines
############################################################
# Step 1: Install and Load Packages ----
if (!require(tidyverse)) {
install.packages("tidyverse")
library(tidyverse)
}
if (!require(tidytext)) {
install.packages("tidytext")
library(tidytext)
}
if (!require(janitor)) {
install.packages("janitor")
library(janitor)
}
if (!require(textdata)) {
install.packages("textdata")
library(textdata)
}
# Step 2: Import Data ----
Trump_headlines <- readRDS(
"Trump_story_headlines.rds"
)
# Step 3: Create Text-Mining Dataset ----
headline_data <- Trump_headlines %>%
select(
id,
publish_date,
media_name,
title
) %>%
filter(!is.na(title)) %>%
mutate(
title = str_replace_all(
title,
"[’‘`]",
"'"
)
)
# Step 4: Examine a Sample of Headlines ----
set.seed(6600)
sample_headlines <- headline_data %>%
slice_sample(n = 100)
View(sample_headlines)
# Step 5: Create Unigrams ----
unigrams <- headline_data %>%
unnest_tokens(
word,
title
)
# Examine sample unigrams
set.seed(6600)
sample_unigrams <- unigrams %>%
select(
publish_date,
media_name,
word
) %>%
slice_sample(n = 100)
View(sample_unigrams)
# Step 6: Remove Stop Words ----
data("stop_words")
unigrams_clean <- unigrams %>%
anti_join(
stop_words,
by = "word"
)
# Step 7: Remove Social Media Artifacts ----
social_media_noise <- c(
"https",
"http",
"t.co",
"tco",
"co",
"com",
"www",
"amp",
"rt",
"twitter",
"x"
)
unigrams_clean <- unigrams_clean %>%
filter(
!word %in% social_media_noise
)
# Step 8: Remove Numbers and Punctuation Fragments ----
unigrams_clean <- unigrams_clean %>%
filter(
!str_detect(word, "^[0-9]+$")
) %>%
filter(
str_detect(word, "[a-z]")
)
# Step 9: Remove Additional Common Headline Words ----
#
# These are words that may appear very frequently
# in Trump-related coverage but do not necessarily
# help identify substantive themes.
custom_stop_words <- tibble(
word = c(
"trump",
"trump's",
"donald",
"president",
"former",
"says",
"said",
"say",
"news",
"report",
"reports",
"latest",
"breaking",
"live",
"update",
"amid",
"u",
"s",
"us",
"u.s",
"top"
)
)
unigrams_final <- unigrams_clean %>%
anti_join(
custom_stop_words,
by = "word"
)
# Step 10: Count Unigrams ----
unigram_counts <- unigrams_final %>%
count(
word,
sort = TRUE
)
# View the most frequent words
head(unigram_counts, 50)
# Step 11: Extract Top 25 Unigrams ----
top_25_words <- unigram_counts %>%
slice_max(
n,
n = 25
)
View(top_25_words)
# Step 12: Create Visualization ----
top_25_chart <- ggplot(
top_25_words,
aes(
x = reorder(word, n),
y = n
)
) +
geom_col(
fill = "steelblue"
) +
geom_text(
aes(label = n),
hjust = -0.15,
size = 3.5
) +
coord_flip() +
scale_y_continuous(
expand = expansion(mult = c(0, .10))
) +
labs(
title = "25 Most Common Unigrams in Trump Headlines",
subtitle = "After removing stop words and common headline artifacts",
x = "Word",
y = "Frequency"
) +
theme_minimal()
top_25_chart
# Optional: Save Figure
ggsave(
filename = "Trump_Headline_Unigrams.png",
plot = top_25_chart,
width = 10,
height = 8,
dpi = 300
)
names(Trump_headlines)