100 hashtags with #15minutecities

100 hashtags with #15minutecities

report

### https://rstudio-pubs-static.s3.amazonaws.com/595002_2d1617098c8c44b494bc2ec97018a82b.html

setwd("C:/Users/mvx13/OneDrive - Texas State University/0_Codes/2023/academicTwitteR/walkablecities")
library(readxl)
dat= read_xlsx("#15minutecities_03252023.xlsx")
dim(dat)
## [1] 48401    30
library(rtweet)
library(tidyverse)
hashtag_pat <- "#[a-zA-Z0-9_-ー\\.]+"
hashtag <- str_extract_all(dat$text, hashtag_pat)

hashtag_word <- unlist(hashtag)
hashtag_word <- tolower(hashtag_word)
hashtag_word <- gsub("[[:punct:]ー]", "", hashtag_word)

hashtag_count <- table(hashtag_word)
top_20_freqs <- sort(hashtag_count, decreasing = TRUE)[1:20]
top_20_freqs
## hashtag_word
##     15minutecities             oxford                wef         agenda2030 
##              28437               3731               2202               1874 
##         greatreset       15minutecity    15minuteprisons        climatescam 
##               1411               1370               1284               1224 
##          digitalid                nwo        15minutecit               cbdc 
##               1143               1134                916                804 
##               ltns      newworldorder        klausschwab               ulez 
##                786                671                555                543 
##       diedsuddenly socialcreditsystem                yeg        smartcities 
##                523                451                425                396
hashtag_word <- hashtag_word[!str_detect(hashtag_word, "15minutecities")]
hashtag_word <- hashtag_word[!str_detect(hashtag_word, "15minutecity")]
hashtag_word <- hashtag_word[!str_detect(hashtag_word, "15minutecit")]
hashtag_word <- hashtag_word[!str_detect(hashtag_word, "smartcities")]

as.data.frame(hashtag_word) %>%
  count(hashtag_word, sort = TRUE) %>%
  mutate(hashtag_word = reorder(hashtag_word, n)) %>%
  top_n(100) %>%
  ggplot(aes(x = hashtag_word, y = n)) +
  geom_col() +
  coord_flip() +theme_bw()+
  labs(x = "Count",
       y = "Hashtag",
       title = "Top 20 Popular Hashtags along with #15minutecities")