The table below shows the percentage of replies to the Nike release that have the words “women”, “sexist”, and “female”. This percentage shows that people are talking about the women’s outfit much more than the male’s.
Mentions of the topic | ||
Topic | Count | Percent |
---|---|---|
0 | 4784 | 87.3 |
1 | 695 | 12.7 |
The words for the table below include words for female body parts and bathing suits. The percentage shows that people brought it up quite a bit for one post.
Mentions of the topic | ||
Topic | Count | Percent |
---|---|---|
0 | 5319 | 97.1 |
1 | 160 | 2.9 |
Code:
# Load packages
if (!require("tidyverse")) install.packages("tidyverse")
if (!require("tidytext")) install.packages("tidytext")
if (!require("plotly")) install.packages("plotly")
if (!require("gtExtras")) install.packages("gtExtras")
library(tidyverse)
library(tidytext)
library(gtExtras)
library(plotly)
library(lubridate)
# Read the data
mydata <- read.csv("https://raw.githubusercontent.com/drkblake/Data/main/NikeUniforms.csv")
# Counting posts about Biden
tidy_text <- mydata %>%
unnest_tokens(word,Full.Text) %>%
count(word, sort = TRUE)
# Deleting standard stop words
data("stop_words")
tidy_text <- tidy_text %>%
anti_join(stop_words)
# Deleting custom stop words
my_stopwords <- tibble(word = c("https",
"t.co",
"rt"))
tidy_text <- tidy_text %>%
anti_join(my_stopwords)
head(tidy_text, 25)
searchterms <- "cunt|vagina|bathing"
mydata$Topic <- ifelse(grepl(searchterms,
mydata$Full.Text,
ignore.case = TRUE),1,0)
Topic <- mydata %>%
group_by(Topic) %>%
summarize(
Count = n(),
Percent = round(n() / nrow(mydata) * 100, 1)
)
TopicTable <- gt(Topic) %>%
tab_header("Mentions of the topic") %>%
cols_align(align = "left") %>%
gt_theme_538
TopicTable
# Load packages
if (!require("tidyverse")) install.packages("tidyverse")
if (!require("tidytext")) install.packages("tidytext")
if (!require("plotly")) install.packages("plotly")
if (!require("gtExtras")) install.packages("gtExtras")
library(tidyverse)
library(tidytext)
library(gtExtras)
library(plotly)
library(lubridate)
# Read the data
mydata <- read.csv("https://raw.githubusercontent.com/drkblake/Data/main/NikeUniforms.csv")
# Counting posts about Biden
tidy_text <- mydata %>%
unnest_tokens(word,Full.Text) %>%
count(word, sort = TRUE)
# Deleting standard stop words
data("stop_words")
tidy_text <- tidy_text %>%
anti_join(stop_words)
# Deleting custom stop words
my_stopwords <- tibble(word = c("https",
"t.co",
"rt"))
tidy_text <- tidy_text %>%
anti_join(my_stopwords)
head(tidy_text, 25)
searchterms <- "cunt|vagina|bathing"
mydata$Topic <- ifelse(grepl(searchterms,
mydata$Full.Text,
ignore.case = TRUE),1,0)
Topic <- mydata %>%
group_by(Topic) %>%
summarize(
Count = n(),
Percent = round(n() / nrow(mydata) * 100, 1)
)
TopicTable2 <- gt(Topic) %>%
tab_header("Mentions of the topic") %>%
cols_align(align = "left") %>%
gt_theme_538
TopicTable2