1. Describe in one sentence what you aim to examine using user-generated text data and sentiment analysis.

I will be analyzing changes in sentiment towards immigration over the past 12 months.

  1. Search Reddit threads using a keyword of your choice.
threads_1 <- find_thread_urls(keywords = "immigrants", 
                              sort_by = 'relevance', 
                             period = 'all') %>% 
  drop_na()
## parsing URLs on page 1...
## parsing URLs on page 2...
## parsing URLs on page 3...
rownames(threads_1) <- NULL

threads_1 %<>% 
  mutate(across(
    where(is.character),
    ~ .x %>%
        str_replace_all("\\|", "/") %>%   
        str_replace_all("\\n", " ") %>%   
        str_squish()                     
  ))

colnames(threads_1)
## [1] "date_utc"  "timestamp" "title"     "text"      "subreddit" "comments" 
## [7] "url"
head(threads_1, 3) %>% knitr::kable()
date_utc timestamp title text subreddit comments url
2025-11-11 1762828247 Mods, can we do something about these russian bots? I’m trying to be racist against other europoors, not immigrants 2westerneurope4u 444 https://www.reddit.com/r/2westerneurope4u/comments/1otxq9o/mods_can_we_do_something_about_these_russian_bots/
2025-02-19 1739962348 White House posts video of immigrants in shackles, calls deportation footage ASMR news 932 https://www.reddit.com/r/news/comments/1it2rla/white_house_posts_video_of_immigrants_in_shackles/
2024-12-28 1735417221 BREAKING: Trump sides with Elon Musk on immigrant visas! LeopardsAteMyFace 1029 https://www.reddit.com/r/LeopardsAteMyFace/comments/1hoebhe/breaking_trump_sides_with_elon_musk_on_immigrant/

Finding subreddit to use

## .
##                news            politics                 law                pics 
##                  42                  24                  12                   8 
##       CringeTikToks   LeopardsAteMyFace         nottheonion              canada 
##                   7                   7                   7                   5 
##     clevercomebacks          technology            illinois     MurderedByWords 
##                   5                   5                   4                   4 
##              europe ImmigrationPathways             MapPorn   NoStupidQuestions 
##                   3                   3                   3                   3 
##      PublicFreakout       AdviceAnimals            AskBrits           AskReddit 
##                   3                   2                   2                   2
Sys.sleep(2)
# using subreddit
threads_2 <- find_thread_urls(subreddit = 'immigration', 
                              sort_by = 'top', 
                              period = 'year') %>% 
  drop_na()
## parsing URLs on page 1...
## parsing URLs on page 2...
## parsing URLs on page 3...
rownames(threads_2) <- NULL

# Sanitize text
threads_2 %<>% 
  mutate(across(
    where(is.character),
    ~ .x %>%
        str_replace_all("\\|", "/") %>% 
        str_replace_all("\\n", " ") %>%
        str_squish()
  ))

head(threads_2, 3) %>% knitr::kable()
date_utc timestamp title text subreddit comments url
2025-04-13 1744517725 A Maryland mother was detained by ICE nearly two weeks ago. So far, no evidence has been provided To Karen Cruz Berrios, her mother is a hard-working, devoted single parent. To the Department of Homeland Security, she is  & an associate of the vicious MS-13 gang. However, nearly two weeks after Elsy Noemi Berrios, 52, was taken into Immigration and Customs Enforcement custody, DHS has yet to disclose any evidence to substantiate its claim against the Salvadoran woman to the public or, her attorneys say, to them. Noemi Berrios was arrested by federal agents in Westminster, Maryland, on the morning of March 31 as she drove to work with her daughter, according to her family. https://www.cnn.com/2025/04/12/us/maryland-mother-ice-trump-gang/index.html immigration 242 https://www.reddit.com/r/immigration/comments/1jxzdgg/a_maryland_mother_was_detained_by_ice_nearly_two/
2025-05-27 1748365046 US Orders Pause in Student-Visa Interviews Ahead of New Vetting https://www.bloomberg.com/news/articles/2025-05-27/us-orders-pause-in-student-visa-interviews-ahead-of-new-vetting Secretary of State Marco Rubio ordered US embassies worldwide to stop scheduling new interviews for student-visa applicants as the Trump administration weighs stricter vetting of social-media profiles. immigration 140 https://www.reddit.com/r/immigration/comments/1kwsgf6/us_orders_pause_in_studentvisa_interviews_ahead/
2025-03-26 1742997642 Tufts international graduate student taken into ICE custody https://www.wgbh.org/news/local/2025-03-26/tufts-international-graduate-student-taken-into-ice-custody immigration 280 https://www.reddit.com/r/immigration/comments/1jkcgfc/tufts_international_graduate_student_taken_into/
head(threads_2$text)
## [1] "To Karen Cruz Berrios, her mother is a hard-working, devoted single parent. To the Department of Homeland Security, she is \034 & an associate of the vicious MS-13 gang.\035 However, nearly two weeks after Elsy Noemi Berrios, 52, was taken into Immigration and Customs Enforcement custody, DHS has yet to disclose any evidence to substantiate its claim against the Salvadoran woman to the public or, her attorneys say, to them. Noemi Berrios was arrested by federal agents in Westminster, Maryland, on the morning of March 31 as she drove to work with her daughter, according to her family. [https://www.cnn.com/2025/04/12/us/maryland-mother-ice-trump-gang/index.html](https://www.cnn.com/2025/04/12/us/maryland-mother-ice-trump-gang/index.html)"                                                                                                                                                                                                                                                                                                                                                              
## [2] "https://www.bloomberg.com/news/articles/2025-05-27/us-orders-pause-in-student-visa-interviews-ahead-of-new-vetting Secretary of State Marco Rubio ordered US embassies worldwide to stop scheduling new interviews for student-visa applicants as the Trump administration weighs stricter vetting of social-media profiles."                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           
## [3] "https://www.wgbh.org/news/local/2025-03-26/tufts-international-graduate-student-taken-into-ice-custody"                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                 
## [4] "The Trump administration insisted Sunday that it has no legal obligation to arrange for the return of a Maryland man illegally deported from the United States, arguing that a Supreme Court ruling last week only requires officials to admit him into the country if he makes it back from a high-security prison in El Salvador. Justice Department lawyers [told a federal judge](https://storage.courtlistener.com/recap/gov.uscourts.mdd.578815/gov.uscourts.mdd.578815.65.0.pdf) that they don\031t interpret the Supreme Court\031s [Thursday ruling](https://www.politico.com/news/2025/04/10/supreme-court-trump-administration-return-el-salvador-deportee-00285813) \024 that the administration \034facilitate\035 Kilmar Abrego Garcia\031s release \024 as obligating the administration to do anything more than adjust his immigration status to admit him if El Salvador\031s government chooses to release him. [https://www.politico.com/news/2025/04/13/abrego-garcia-el-salvador-trump-administration-00288502](https://www.politico.com/news/2025/04/13/abrego-garcia-el-salvador-trump-administration-00288502)"
## [5] "I think it\031s fair to say this is a bad argument. Maybe Americans don\031t want to do these \034shitty\035 jobs because the pay is so low. Maybe the pay is so low because someone from somewhere else came to do it for cheap because the jobs pay even lower where they came from. I\031d venture to say when many illegal immigrants are deported from a single business, that business would have no other option than to pay Americans a more fair wage or shut down. They do the jobs Americans don\031t want to do because they bring wages down."                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                             
## [6] "I am an immigrant and now US citizen. I have always been legal status. Struggle has been real. Solitude and economic hardship. Forever fighting with restrictions and unfairness. When things were hard, I got temptation of using system but have never been illegal status out of fear. I am proud to be rigorous and respect the law and system. I feel bad to have hatred mind toward illegal immigrants, as much as I suffered. I feel bad I have this feeling and have to argue with people who only have naive point of view toward illegal immigrants. I thought I have won; I earned and yet, people say I am the problem with no moral and ethical values. I feel I am defeated."
Sys.sleep(2)
# using both subreddit and keyword
threads_3 <- find_thread_urls(keywords= 'immigrants', 
                              subreddit = 'immigration', 
                              sort_by = 'relevance', 
                              period = 'all') %>% 
  drop_na()
## parsing URLs on page 1...
## parsing URLs on page 2...
## parsing URLs on page 3...
rownames(threads_3) <- NULL

# Sanitize text
threads_3 %<>% 
  mutate(across(
    where(is.character),
    ~ .x %>%
        str_replace_all("\\|", "/") %>% 
        str_replace_all("\\n", " ") %>% 
        str_squish() 
  ))


head(threads_3, 3) %>% knitr::kable()
date_utc timestamp title text subreddit comments url
2025-02-13 1739489055 Immigration lawyer telling my wife her marriage visa case has no hope and will surely be denied. Immigration lawyer is telling my wife there’s no chance for her case to get a residency. She’s supposed to have an open asylum case but last lawyers didn’t file and she has no status. She has a work permit and a SS#. Is there any options? immigration 74 https://www.reddit.com/r/immigration/comments/1iowoz0/immigration_lawyer_telling_my_wife_her_marriage/
2025-08-20 1755696657 Feeling hurt and powerless watching my ex move on for immigration  need perspective Im going through a really complicated situation and need some perspective. I was in a relationship with a guy for two years. It was real and deep  we shared everything, including intimate moments, and I truly cared about him. He had some insecurities and was a little toxic at times, especially thinking I might be talking to other guys, but I stayed with him through it because I loved him. During our relationship, he got arrested twice  once for something I wont share and once for reckless driving. After the second arrest, immigration picked him up from jail and put him in deportation proceedings. While he was in jail, his father even harassed me to help him. When he got out, he was upset that I hadnt visited him for a couple of months, but we reconnected and started rebuilding our relationship. At one point, he asked me to marry him, but I couldnt provide immigration papers, so I said no. I thought that was the end of it, but literally four days later, he moved on and had a new girlfriend  seemingly to help with his immigration situation. Hes out on bond right now with an ankle monitor and his lawyer told him to move fast. Since then, hes completely cut me off. He tells me he hates me, calls me names, and blames me for problems in his life. Despite this, I notice little things that suggest hes conflicted and stressed: He posted photos of his new girlfriend, then disabled his Instagram, then reactivated it and started removing followers and losing people quickly. He seems obsessed with controlling perception, which shows hes anxious and still feeds off attention. Ive realized my power is in staying away. Im not engaging, not blaming, and trying to protect my peace. But its hard because: I feel hurt that he moved on so fast. I wonder if he misses the connection we had, even if he wont admit it. I struggle with the fact that he acts like he hates me when deep down, it seems like hes conflicted. I also know objectively that his plan is risky  marriages for papers are heavily scrutinized, especially for someone already in deportation proceedings. His new relationship seems transactional, fragile, and stressful, both legally and emotionally. I just want to process my feelings and maybe get some insight into whether Im right to think that, eventually, hell realize the problem is him, not me. Also, any advice on coping with seeing an ex move on in ways that feel manipulative or calculated would be appreciated. Im not dumb, I know i dodged a bullet but somehow deep down I feel if I helped him it would’ve fixed everything. He overstayed his Visa by more than 3 years, got arrested twice (one for violence if sorts) and is in deportation proceedings as we speak. immigration 60 https://www.reddit.com/r/immigration/comments/1mvevo5/feeling_hurt_and_powerless_watching_my_ex_move_on/
2025-11-11 1762876801 I’m an immigrant who is moving to Los Angeles soon to marry my fiance Ill be moving to Los Angeles soon to marry my fiance and Ive been trying to get a handle on all the legal and financial details that come with it not just the immigration paperwork. One thing thats been on my mind lately is whether it makes sense to have a prenuptial agreement. I know prenups can help set clear expectations, especially when one persons already established in the US and the others just getting started but Im not sure how that fits with the immigration process. Ive read that certain legal documents cant interfere with immigration filings and I definitely dont want to do anything that could raise red flags or slow things down. Has anyone here gone through something similar either as the immigrant or the US citizen partner? Would love to hear what others did like when you started the prenup process, if it affected your visa or adjustment of status at all or how you handled finances while waiting for work authorization. Just trying to go into this with my eyes open and make sure we handle both sides (love + logistics) the right way. Any insights or experiences would really help. immigration 22 https://www.reddit.com/r/immigration/comments/1oud6pl/im_an_immigrant_who_is_moving_to_los_angeles_soon/
summary(threads_3$date_utc)
##    Length     Class      Mode 
##       237 character character

Downloading comments

threads_2_content <- get_thread_content(threads_2$url[1:4])
  1. Clean your text data
# Sanitize text
threads_2_content$comments %<>%
  mutate(across(
    where(is.character),
    ~ .x %>%
        str_replace_all("\\|", "/") %>% 
        str_replace_all("\\n", " ") %>% 
        str_squish() 
  ))

head(threads_2_content$comments, 3) %>% knitr::kable()
url author date timestamp score upvotes downvotes golds comment comment_id
https://www.reddit.com/r/immigration/comments/1jxzdgg/a_maryland_mother_was_detained_by_ice_nearly_two/ SelectionDapper553 2025-04-13 1744518734 158 158 0 0 These people are fucking EVIL. Trump voters. You voted for pure evil. This is the United States of America. I have no idea what this woman has done. Thats why we have a court system. 1
https://www.reddit.com/r/immigration/comments/1jxzdgg/a_maryland_mother_was_detained_by_ice_nearly_two/ [deleted] 2025-04-14 1744596797 12 12 0 0 I agree. Beware of the people who voted for Trump. 1_1
https://www.reddit.com/r/immigration/comments/1jxzdgg/a_maryland_mother_was_detained_by_ice_nearly_two/ [deleted] 2025-04-15 1744746016 2 2 0 0 [removed] 1_1_1

Adding dates.

threads_2 %<>% 
  mutate(date = as.POSIXct(date_utc)) %>%
  filter(!is.na(date))
# create new columns: day_of_week, is_weekend
threads_2 %<>%  
  mutate(day_of_week = wday(date, label = TRUE)) %>% 
  mutate(is_weekend = ifelse(day_of_week %in% c("Sat", "Sun"), "Weekend", "Weekday"))
threads_2 %<>%  
  mutate(time = timestamp %>% 
           anytime(tz = anytime:::getTZ()) %>% 
           str_split('-| |:') %>% 
           sapply(function(x) as.numeric(x[4])))
  1. Tokenize your data
# Word tokenization
words <- threads_2 %>% 
  unnest_tokens(output = word, input = text, token = "words") 

words %>%
  count(word, sort = TRUE) %>%
  top_n(20) %>%
  mutate(word = reorder(word, n)) %>%
  ggplot(aes(x = word, y = n)) +
  geom_col() +
  xlab(NULL) +
  coord_flip() +
  labs(x = "words",
       y = "counts",
       title = "Unique wordcounts")
## Selecting by n

Remove stop words

# Regex that matches URL-type string
replace_reg <- "http[s]?://[A-Za-z\\d/\\.]+|&amp;|&lt;|&gt;"

words_clean <- threads_2 %>% 
  # drop URLs
  mutate(text = str_replace_all(text, replace_reg, "")) %>%
  # Tokenization (word tokens)
  unnest_tokens(word, text, token = "words") %>% 
  # drop stop words
  anti_join(stop_words, by = "word") %>% 
  # drop non-alphabet-only strings
  filter(str_detect(word, "[a-z]"))

# Check the number of rows after removal of the stop words. There should be fewer words now
print(
  glue::glue("Before: {nrow(words)}, After: {nrow(words_clean)}")
)
## Before: 32990, After: 12741
words_clean %>%
  count(word, sort = TRUE) %>%
  top_n(20, n) %>%
  mutate(word = reorder(word, n)) %>%
  ggplot(aes(x = word, y = n)) +
  geom_col() +
  xlab(NULL) +
  coord_flip() +
  labs(x = "words",
       y = "counts",
       title = "Unique wordcounts")

4. Generate a word cloud that illustrates the frequency of words excluding your keyword.

words_clean %>% 
  filter(word != "immigration") %>%   
  count(word, sort = TRUE) %>%
  wordcloud2()

Get trigrams

words_ngram <- threads_2 %>%
  mutate(text = str_replace_all(text, replace_reg, "")) %>%
  select(text) %>%
  unnest_tokens(output = trigram_words,
                input = text,
                token = "ngrams",
                n = 3)
words_ngram_pair <- words_ngram %>%
  separate(trigram_words, c("word1", "word2", "word3"), sep = " ")


words_ngram_pair_filtered <- words_ngram_pair %>%
  filter(!word1 %in% stop_words$word & !word2 %in% stop_words$word & !word3 %in% stop_words$word) %>% 
  filter(str_detect(word1, "[a-z]") & str_detect(word2, "[a-z]") & str_detect(word3,"[a-z]"))


library(stringi)
## Warning: package 'stringi' was built under R version 4.3.3
words_ngram_pair_filtered %<>% 
  filter(stri_enc_isascii(word1) & stri_enc_isascii(word2) & stri_enc_isascii(word3))

words_counts <- words_ngram_pair_filtered %>%
  count(word1, word2, word3) %>%
  arrange(desc(n))

head(words_counts, 20) %>% 
  knitr::kable()
word1 word2 word3 n
president donald trump 9
green card holders 8
temporary protected status 7
child care workers 5
kilmar abrego garcia 5
deal share data 4
green card holder 4
president donald trump’s 4
cbp information center 3
customs enforcement ice 3
el salvador trump 3
embedded checkout true 3
garcia el salvador 3
ice detention center 3
immigrant trumps deportations 3
local law enforcement 3
supreme court ruling 3
u.s immigration detention 3
287g program expansion 2
2be6 5ab7 857e 2

Discuss any noteworthy tri-grams you come across. It is interesting that the most trigrams present is President Donald Trump. It’s clear that the current politics dominate the conversation around immigration, which is unsurprising. Some of the trigrams are also related to status – green card holders and temporary protected status, which shows that people are mainly talking about different statuses and based on the trigrams customs enforcement ice, ice detention center, and immigrant trumps deportations, they are talking about how status can affect how the legal system is treating them. A wild card is child care workers. I’m surprised that is so high up on the list,because it doesn’t match the tone of the other trigrams.

#Export for colab
export_data <- threads_2 %>%
  select(title, text, date_utc, subreddit, url)

write_csv(export_data, "reddit_threads_immigration.csv")
#import sentiment analysis 
reddit_sentiment <- read_csv("~/Downloads/sample_reddit_bert.csv")
## New names:
## Rows: 250 Columns: 8
## ── Column specification
## ──────────────────────────────────────────────────────── Delimiter: "," chr
## (5): title, text, subreddit, url, bert_label dbl (2): ...1, bert_score date
## (1): date_utc
## ℹ Use `spec()` to retrieve the full column specification for this data. ℹ
## Specify the column types or set `show_col_types = FALSE` to quiet this message.
## • `` -> `...1`
# drop NAs
reddit_sentiment %<>% drop_na('bert_label')

Perform a sentiment analysis on your text data using a dictionary method that accommodates negations.

library(sentimentr)
reddit_sentiment %<>%
  mutate(title = replace_na(title, ""),
         text = replace_na(text, ""),
         title_text = str_c(title, text, sep = ". "))

reddit_sentiment_dictionary <- sentiment_by(reddit_sentiment$title_text)

reddit_sentiment$sentiment_dict <- reddit_sentiment_dictionary %>% pull(ave_sentiment)
reddit_sentiment$word_count <- reddit_sentiment_dictionary %>% pull(word_count)

Display 10 sample texts alongside their sentiment scores and evaluate the credibility of the sentiment analysis outcomes.

sample_texts <- reddit_sentiment %>%
  slice_sample(n = 10)
sample_texts %>%
  mutate(
    sentiment_label = case_when(
      sentiment_dict > 0 ~ "positive",
      sentiment_dict < 0 ~ "negative",
      TRUE ~ "neutral"        
    )
  ) %>%
  mutate(row = row_number()) %>%           
  select(row, everything()) %>%            
  knitr::kable()
row …1 title text date_utc subreddit url bert_label bert_score title_text sentiment_dict word_count sentiment_label
1 99 The border is quiet. Lauren Villagran here, journalist with USA TODAY. Migrant apprehensions at the U.S.-Mexico border by Border Patrol have dropped dramatically. Not news – this has been the trend all year – but the end-of-year numbers are pretty dramatic. The border hasn’t been this quiet since… 1970. https://www.usatoday.com/story/news/politics/2025/10/08/illegal-border-crossings-plunge-amid-trump-crackdown/86585965007/ 2025-10-09 immigration https://www.reddit.com/r/immigration/comments/1o2fchq/the_border_is_quiet/ 3 stars 0.3149624 The border is quiet.. Lauren Villagran here, journalist with USA TODAY. Migrant apprehensions at the U.S.-Mexico border by Border Patrol have dropped dramatically. Not news – this has been the trend all year – but the end-of-year numbers are pretty dramatic. The border hasn’t been this quiet since… 1970. https://www.usatoday.com/story/news/politics/2025/10/08/illegal-border-crossings-plunge-amid-trump-crackdown/86585965007/ -0.0880669 78 negative
2 171 Trump confirms hes open to deporting naturalized citizens https://www.theguardian.com/us-news/live/2025/apr/14/donald-trump-tariffs-china-smartphones-computers-semiconductors-immigration-us-politics-live-updates?CMP=share_btn_url&page=with%3Ablock-67fd3b218f088ecb3fe472df#block-67fd3b218f088ecb3fe472df 2025-04-14 immigration https://www.reddit.com/r/immigration/comments/1jz4rqi/trump_confirms_hes_open_to_deporting_naturalized/ 1 star 0.6224985 Trump confirms hes open to deporting naturalized citizens. https://www.theguardian.com/us-news/live/2025/apr/14/donald-trump-tariffs-china-smartphones-computers-semiconductors-immigration-us-politics-live-updates?CMP=share_btn_url&page=with%3Ablock-67fd3b218f088ecb3fe472df#block-67fd3b218f088ecb3fe472df -0.0181895 50 negative
3 196 Trumps Deportation Plan Is Said to Start Next Week targeting Sanctuary Cities 2025-01-18 immigration https://www.reddit.com/r/immigration/comments/1i4287g/trumps_deportation_plan_is_said_to_start_next/ 1 star 0.4086996 Trumps Deportation Plan Is Said to Start Next Week targeting Sanctuary Cities. 0.0832050 13 positive
4 72 We Found That More Than 170 U.S. Citizens Have Been Held by Immigration Agents. Theyve Been Kicked, Dragged and Detained for Days. 2025-10-16 immigration https://www.reddit.com/r/immigration/comments/1o8ebks/we_found_that_more_than_170_us_citizens_have_been/ 1 star 0.5948367 We Found That More Than 170 U.S. Citizens Have Been Held by Immigration Agents. Theyve Been Kicked, Dragged and Detained for Days.. 0.0146634 23 positive
5 153 Do not go to immigration offices without a lawyer My cousin got deported a few days ago. He got a call and a letter from immigration saying his green card had been approved but he had to go sign some papers. It turns out, the papers he signed were for deportation. His lawyer didn’t show up so he was by himself. I’m guessing he didn’t even read the papers and did what the agents told him to do because they told him his green card was already approved. My mom told me she saw a deportee being interviewed on the news and he had the same story as my cousin. Please do not sign anything before having your lawyer read it. And please do not go to the immigration offices without a lawyer! 2025-01-29 immigration https://www.reddit.com/r/immigration/comments/1id19yg/do_not_go_to_immigration_offices_without_a_lawyer/ 1 star 0.7082809 Do not go to immigration offices without a lawyer. My cousin got deported a few days ago. He got a call and a letter from immigration saying his green card had been approved but he had to go sign some papers. It turns out, the papers he signed were for deportation. His lawyer didn’t show up so he was by himself. I’m guessing he didn’t even read the papers and did what the agents told him to do because they told him his green card was already approved. My mom told me she saw a deportee being interviewed on the news and he had the same story as my cousin. Please do not sign anything before having your lawyer read it. And please do not go to the immigration offices without a lawyer! -0.0897127 133 negative
6 193 FBI arrests Judge Hannah Dugan accused of helping undocumented migrant flee ICE arrest Federal agents have arrested Milwaukee County Circuit Court Judge Hannah Dugan on charges of obstruction after she allegedly interfered with an immigration enforcement operation inside her courtroom, the FBI announced Friday. According to the bureau, Dugan is accused of deliberately misdirecting federal agents away from Eduardo Flores Ruiz, an undocumented migrant targeted for arrest by U.S. Immigration and Customs Enforcement on April 18. https://www.themirror.com/news/politics/breaking-fbi-arrests-judge-hannah-1113957 2025-04-25 immigration https://www.reddit.com/r/immigration/comments/1k7mo3l/fbi_arrests_judge_hannah_dugan_accused_of_helping/ 1 star 0.4729190 FBI arrests Judge Hannah Dugan accused of helping undocumented migrant flee ICE arrest. Federal agents have arrested Milwaukee County Circuit Court Judge Hannah Dugan on charges of obstruction after she allegedly interfered with an immigration enforcement operation inside her courtroom, the FBI announced Friday. According to the bureau, Dugan is accused of deliberately misdirecting federal agents away from Eduardo Flores Ruiz, an undocumented migrant targeted for arrest by U.S. Immigration and Customs Enforcement on April 18. https://www.themirror.com/news/politics/breaking-fbi-arrests-judge-hannah-1113957 -0.3957015 98 negative
7 70 I’m an Indian living in Europe and I wish more of us would learn to blend in I’m from India, currently living in Italy for my studies and I’ll be honest here, l’ve never faced racism or felt unwelcome here. People have been kind, polite, and genuinely curious about my background. But here’s the thing, l’ve also made an effort to respect and adapt to the culture I’m living in. I dress like locals, follow social etiquette, and try to speak their language. I observe first, act second. It’s not about pretending to be someone else, it’s about being respectful enough to understand the place that’s hosting you. Sadly, I’ve seen some fellow Indians abroad doing the opposite…being loud in public, leaving trash behind, forming groups that isolate them from locals, or acting like the world should adjust to their habits. I get it, we love our culture. But when we move abroad, it’s not about imposing it. It’s about carrying it gracefully. If you’re living or traveling abroad, remember that you’re representing 1.4 billion people whether you mean to or not and locals often form their impression of India through you. Let’s make people remember us for our kindness, respect, and adaptability, not for our unwillingness to integrate. 2025-11-27 immigration https://www.reddit.com/r/immigration/comments/1p828zl/im_an_indian_living_in_europe_and_i_wish_more_of/ 4 stars 0.3736452 I’m an Indian living in Europe and I wish more of us would learn to blend in. I’m from India, currently living in Italy for my studies and I’ll be honest here, l’ve never faced racism or felt unwelcome here. People have been kind, polite, and genuinely curious about my background. But here’s the thing, l’ve also made an effort to respect and adapt to the culture I’m living in. I dress like locals, follow social etiquette, and try to speak their language. I observe first, act second. It’s not about pretending to be someone else, it’s about being respectful enough to understand the place that’s hosting you. Sadly, I’ve seen some fellow Indians abroad doing the opposite…being loud in public, leaving trash behind, forming groups that isolate them from locals, or acting like the world should adjust to their habits. I get it, we love our culture. But when we move abroad, it’s not about imposing it. It’s about carrying it gracefully. If you’re living or traveling abroad, remember that you’re representing 1.4 billion people whether you mean to or not and locals often form their impression of India through you. Let’s make people remember us for our kindness, respect, and adaptability, not for our unwillingness to integrate. 0.1969162 209 positive
8 65 President Trump says he’ll ‘have to take a look’ at deporting Elon Musk as feud reignites Hi r/immigration, it’s Sydney from USA TODAY. President Donald Trump said he would look at having Elon Musk deported to his native South Africa as their rift reignited and reached new heights amid the billionaire tech entrepreneur’s latest wave of criticism of Trump’s tax and budget bill. Trump made the threat while speaking to reporters on July 1, hours after the president in an early morning post on Truth Social said he might order the Department of Government Efficiency that Musk previously led to review the billions in contracts that his companies receive. Read more: https://www.usatoday.com/story/news/politics/2025/07/01/trump-musk-south-africa/84427588007/ 2025-07-01 immigration https://www.reddit.com/r/immigration/comments/1lp2ll8/president_trump_says_hell_have_to_take_a_look_at/ 1 star 0.5055017 President Trump says he’ll ‘have to take a look’ at deporting Elon Musk as feud reignites. Hi r/immigration, it’s Sydney from USA TODAY. President Donald Trump said he would look at having Elon Musk deported to his native South Africa as their rift reignited and reached new heights amid the billionaire tech entrepreneur’s latest wave of criticism of Trump’s tax and budget bill. Trump made the threat while speaking to reporters on July 1, hours after the president in an early morning post on Truth Social said he might order the Department of Government Efficiency that Musk previously led to review the billions in contracts that his companies receive. Read more: https://www.usatoday.com/story/news/politics/2025/07/01/trump-musk-south-africa/84427588007/ -0.0767597 133 negative
9 225 10 year GC holder questioned and detained in NH after US re-entry- Dont leave the US right now https://www.wgbh.org/news/local/2025-03-14/green-card-holder-from-new-hampshire-interrogated-at-logan-airport-detained 2025-03-15 immigration https://www.reddit.com/r/immigration/comments/1jbuiuw/10_year_gc_holder_questioned_and_detained_in_nh/ 1 star 0.6692187 10 year GC holder questioned and detained in NH after US re-entry- Dont leave the US right now. https://www.wgbh.org/news/local/2025-03-14/green-card-holder-from-new-hampshire-interrogated-at-logan-airport-detained -0.0542425 36 negative
10 244 Detained by ICE today with order of deportation i have a very close friend who was brought here at age 5 over 40 years ago by her parents from Ecuador. she was still a child. she never has been able to adjust her status and at some point was married and on the path of getting a citizenship through that but her marriage ended in divorce and she lost that ability to adjust her status. her sister who was born here has sponsored her in 2019 and she has been going for regular check ins with immigration every 6 months. today when she went in to check in she got detained by ICE and they are looking to deport her. is there anything that can be done legally to challenge that and to stop that order of deportation? 2025-09-13 immigration https://www.reddit.com/r/immigration/comments/1nfnrho/detained_by_ice_today_with_order_of_deportation/ 1 star 0.4875934 Detained by ICE today with order of deportation. i have a very close friend who was brought here at age 5 over 40 years ago by her parents from Ecuador. she was still a child. she never has been able to adjust her status and at some point was married and on the path of getting a citizenship through that but her marriage ended in divorce and she lost that ability to adjust her status. her sister who was born here has sponsored her in 2019 and she has been going for regular check ins with immigration every 6 months. today when she went in to check in she got detained by ICE and they are looking to deport her. is there anything that can be done legally to challenge that and to stop that order of deportation? -0.0538315 134 negative

I would say that all of the negative ones seem to be accurate as well as the neutral one. Some of the positive ones don’t seem to be accurate.

Number 2:Trump proposes giving green cards to international grads of U.S. colleges. https://www.cnn.com/2024/12/06/politics/green-cards-college-graduates-trump-cec Remember what he said before the election and how hopeful some people were? Moral of the story: Dont trust Trumps promises. This seems negative because it’s warning to not trust him. But the sentiment analysis said this was positive.

Number 4: 4 Losing good workers. Several of company employees are self deporting back. I did not realize how much some of this people save up. One guy has $50,000 in cash savings plus a house in us nearly paid off. These are hard working people. These are LEGAL permanent residents. This is also showing positive. I guess it is showing immigrants and immigration in a positive light but it’s saying that it’s sad a lot of people are being lost, so this positive one feels ambiguous to me.

And again, number 6 is positive and is providing information for immigrants which is showing immigration in a positive light.

Overall, I would say for the most part I would say the sentiment analysis is accurate with a few ambiguities here and there.

Distribution of dictionary sentiment

reddit_sentiment <- reddit_sentiment %>%
  mutate(sentiment_cat = case_when(
    sentiment_dict > 0 ~ "Positive",
    sentiment_dict < 0 ~ "Negative",
    TRUE ~ "Neutral"
  ))

reddit_sentiment %>%
  ggplot(aes(x = sentiment_dict)) +
  geom_histogram(bins = 30, fill = "white", color = "grey40") +
  labs(
    title = "Distribution of Sentiment Scores",
    x = "Sentiment Score",
    y = "Count"
  ) +
  theme_minimal()

sentiment_summary <- reddit_sentiment %>%
  count(sentiment_cat)

sentiment_summary
## # A tibble: 3 × 2
##   sentiment_cat     n
##   <chr>         <int>
## 1 Negative        130
## 2 Neutral           9
## 3 Positive         89

Word Count by Sentiment

reddit_sentiment %>%
  ggplot(aes(x = sentiment_cat, y = word_count)) +
  geom_jitter(height = 0, width = 0.05, alpha = 0.5) +
  labs(
    title = "Word Count by Sentiment Category",
    x = "Sentiment Category",
    y = "Word Count"
  ) +
  theme_minimal()

Temporal Distribution

reddit_sentiment %<>%
  mutate(date = as.POSIXct(date_utc, tz = "UTC")) %>%
  filter(!is.na(date)) %>%
  mutate(
    year = year(date),
    month = month(date, label = TRUE, abbr = TRUE),   
    day_of_week = wday(date, label = TRUE),
    is_weekend = ifelse(day_of_week %in% c("Sat", "Sun"), "Weekend", "Weekday"),
    time = hour(date)
  )
reddit_sentiment <- reddit_sentiment %>%
  mutate(
    sentiment_cat = ifelse(sentiment_dict > 0, "Positive", "Negative")
  )
reddit_sentiment %>%
  ggplot(aes(x = day_of_week, fill = sentiment_cat)) +
  geom_bar(position = "fill") +
  theme_minimal() +
  labs(title = "Sentiment by Day of Week")

reddit_sentiment %>%
  ggplot(aes(x = month, fill = sentiment_cat)) +
  geom_bar(position = "fill") +
  theme_minimal() +
  labs(title = "Sentiment by Month")

# Takeaways

Number of posts

There are more negative than positive posts with a small number of neutral posts. THis makes sense, as this focuses on the reddit thread of immigration which has come fire this year under the Trump administration. There are personal stories as well as news articles on this thread, many of them clearly depicting fear, uncertainty, and deportation with convos on how to navigate this legal system.

Looking at word count

While there are more negative posts than positive, the word count seems to be the same for both. This could be because the negative posts are often long anecdotes and the positive ones are advice or summaries of news.

Temporal analysis

It seems there is the highest positive amount of posts on Saturday.For the year, there was a dip in the proportion of positive posts in March and it’s showing that there were no positive posts in December. THe dip in March could be due to how that’s when a lot of Trump’s immigration policies started to take place. The slight upticks in May and August are because of maybe some positive updates for immigration, like new incentives for self-deportation (I’m not sure how entirely positive that is, but the sentiment analysis could consider it as so.)