Reputation: 109
I have a list of words in a dataset .
My question: Any idea how to fix the following code?
new_words <- c("it", "apple", "carrot", "after",
"snake")
# My first solution
removeWords(new_words,
words = stopwords (kind = "en")
# I have a problem in the Second solution,
# because I want to use #%in% operator
new_words[new_words %in%
words = stopwords(kind = "en")]
Upvotes: 3
Views: 86
Reputation: 9
why not just anti_join(stop_words)
?
that's how Julia Silge does it in Text Mining for R... https://www.tidytextmining.com/index.html
Upvotes: 1