2024-03-19

Data Wrangling

austen_pride <- austen_books() %>% filter(book == "Pride & Prejudice",
                                          text != "")

pride_bigrams <- austen_pride %>%
  unnest_tokens(bigram, text, token = "ngrams", n = 2)

Data wrangling: including mr and mrs

pride_sep <- pride_bigrams %>% filter(!is.na(bigram)) %>%
  count(bigram, sort = TRUE) %>% separate(bigram, 
                                          c("word1", "word2"), 
                                          sep = " ") 

pride_sep_mr <- pride_sep %>% filter(word1 %in% c("mr","mrs"))
pride_sep_2 <-  pride_sep %>% filter(!word1 %in% stop_words$word) %>%
  filter(!word2 %in% stop_words$word) 
pride_counts <- bind_rows(pride_sep_mr, pride_sep_2) 

What did we find?

Conlusion and future ideas

  • Lots of talk about characters, and characters interacting with other characters
  • Looking at how characters talk connects them with others, if there are things they mututally discuss