obtaining n-grams following this book on tydy-text: http://tidytextmining.com/ngrams.html
The code:
library(tidyr)
bigrams_separated <- austen_bigrams %>%
separate(bigram, c("word1", "word2"), sep = " ")
bigrams_filtered <- bigrams_separated %>%
filter(!word1 %in% stop_words$word) %>%
filter(!word2 %in% stop_words$word)
# new bigram counts:
bigram_counts <- bigrams_filtered %>%
count(word1, word2, sort = TRUE)
I get an error:
Warning: Error in : 'sep' is not an exported object from 'namespace:dplyr'