I created a bigram from one speech and counted how many times each phrase was used. Following is the code and I attached its result.
bigram_counts_u <- bigram_counts %>% unite("word", word1:word2, sep = " ")
bigram_counts_u %>% top_n(15) %>%
ggplot(aes(fct_reorder(word, n), n)) +
geom_col() +
coord_flip() +
labs(x = NULL)
The problem is, there are "naval force" and "naval forces" which are the same. So I want to merge them together. I tried Str_replace_all function, but I got this error:
In stri_detect_regex(string, pattern, negate = negate, opts_regex = opts(pattern)) :
argument is not an atomic vector; coercing
Is there any way that I can merge "naval force" and "naval forces" into one?